Commit 0bdaa3a4 authored by Markus Armbruster's avatar Markus Armbruster
Browse files

memory: Fix bad error handling in memory_region_init_ram_ptr()



Commit ef701d7b 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 39228250 "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 33e0eb52.  This commit fixes the third one.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Message-Id: <1441983105-26376-5-git-send-email-armbru@redhat.com>
Reviewed-by: default avatarPeter Crosthwaite <crosthwaite.peter@gmail.com>
parent df8abec8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)