[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 097/106] numa: handle mmaped memory allocation fai
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 097/106] numa: handle mmaped memory allocation failure correctly |
Date: |
Wed, 18 Jun 2014 19:22:04 +0300 |
From: Igor Mammedov <address@hidden>
when memory_region_init_ram_from_file() fails
memory_region_size() will still return size that was
provided at region init time.
Instead use errp to properly detect error condition.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
numa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/numa.c b/numa.c
index eef0717..e471afe 100644
--- a/numa.c
+++ b/numa.c
@@ -238,7 +238,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion
*mr, Object *owner,
/* Legacy behavior: if allocation failed, fall back to
* regular RAM allocation.
*/
- if (!memory_region_size(mr)) {
+ if (err) {
qerror_report_err(err);
error_free(err);
memory_region_init_ram(mr, owner, name, ram_size);
--
MST
- [Qemu-devel] [PULL v2 087/106] qmp: add query-memdev, (continued)
- [Qemu-devel] [PULL v2 087/106] qmp: add query-memdev, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 089/106] tests: fix memory leak in test of string input visitor, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 088/106] hmp: add info memdev, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 090/106] qapi: make string input visitor parse int list, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 091/106] qapi: make string output visitor parse int list, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 093/106] qdev: reorganize error reporting in bus_set_realized, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 092/106] qapi: fix build on glib < 2.28, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 094/106] qdev: recursively unrealize devices when unrealizing bus, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 096/106] pc: acpi: do not hardcode preprocessor, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 095/106] qmp: clean out whitespace, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 097/106] numa: handle mmaped memory allocation failure correctly,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 099/106] acpi: introduce TYPE_ACPI_DEVICE_IF interface, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 098/106] qmp: add query-memory-devices command, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 100/106] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 101/106] qmp: add query-acpi-ospm-status command, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 102/106] qmp: add ACPI_DEVICE_OST event handling, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 104/106] qapi: fix input visitor bugs, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 103/106] acpi: rephrase comment, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 019/106] acpi: rename cpu_hotplug_defs.h to pc-hotplug.h, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 016/106] pc: add memory hotplug handler to PC_MACHINE, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 077/106] memory: add error propagation to file-based RAM allocation, Michael S. Tsirkin, 2014/06/18