From 39228250ce6cf67eb1c3799791d271f53c5c6347 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 31 Jul 2013 15:11:11 +0200 Subject: exec: Don't abort when we can't allocate guest memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We abort() on memory allocation failure. abort() is appropriate for programming errors. Maybe most memory allocation failures are programming errors, maybe not. But guest memory allocation failure isn't, and aborting when the user asks for more memory than we can provide is not nice. exit(1) instead, and do it in just one place, so the error message is consistent. Tested-by: Christian Borntraeger Signed-off-by: Markus Armbruster Reviewed-by: Andreas Färber Acked-by: Laszlo Ersek Acked-by: Stefano Stabellini Acked-by: Christian Borntraeger Message-id: 1375276272-15988-8-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori --- util/oslib-win32.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'util/oslib-win32.c') diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 961fbf5..983b7a2 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -65,10 +65,7 @@ void *qemu_anon_ram_alloc(size_t size) /* FIXME: this is not exactly optimal solution since VirtualAlloc has 64Kb granularity, but at least it guarantees us that the memory is page aligned. */ - if (!size) { - abort(); - } - ptr = qemu_oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE)); + ptr = VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE); trace_qemu_anon_ram_alloc(size, ptr); return ptr; } -- cgit v1.1