]> xenbits.xensource.com Git - osstest/qemu.git/commitdiff
memory: Fix bad error handling in memory_region_init_ram_ptr()
authorMarkus Armbruster <armbru@redhat.com>
Fri, 11 Sep 2015 14:51:45 +0000 (16:51 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 18 Sep 2015 12:39:39 +0000 (14:39 +0200)
Commit ef701d7 screwed up handling of out-of-memory conditions.
Before the commit, we report the error and exit(1), in one place.  The
commit lifts the error handling up the call chain some, to three
places.  Fine.  Except it uses &error_abort in these places, changing
the behavior from exit(1) to abort(), and thus undoing the work of
commit 3922825 "exec: Don't abort when we can't allocate guest
memory".

The previous two commits fixed one of the three places, another one
was fixed in commit 33e0eb5.  This commit fixes the third one.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1441983105-26376-5-git-send-email-armbru@redhat.com>
Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
memory.c

index 0d8b2d96a993273ea0ac000bc6fecdb0fdd3f6a6..ef87363067bafdc5cc67c6ac90149b6a25cb532a 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -1251,7 +1251,7 @@ void memory_region_init_ram_ptr(MemoryRegion *mr,
 
     /* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL.  */
     assert(ptr != NULL);
-    mr->ram_addr = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_abort);
+    mr->ram_addr = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal);
 }
 
 void memory_region_set_skip_dump(MemoryRegion *mr)