diff options
author | Igor Mammedov <imammedo@redhat.com> | 2014-06-17 12:17:05 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 18:44:22 +0300 |
commit | c3ba3095070728f9c247f9e89652b9ea3f94319f (patch) | |
tree | be4053d7b94cc130a98a3cd60b1285b46aaa69dd | |
parent | dc61b2953121bf3656cd79efd4f2437dacfd6d8a (diff) |
numa: handle mmaped memory allocation failure correctly
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 <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | numa.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |