path: root/util/oslib-win32.c
diff options
authorMarkus Armbruster <>2013-07-31 15:11:11 +0200
committerAnthony Liguori <>2013-09-12 11:45:32 -0500
commit39228250ce6cf67eb1c3799791d271f53c5c6347 (patch)
treea9fb3a2fb09d86c1014c296593cd5d70ea4bf8b1 /util/oslib-win32.c
parente1e84ba050538bae24393e40b737078ecad99747 (diff)
exec: Don't abort when we can't allocate guest memory
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: Signed-off-by: Anthony Liguori <>
Diffstat (limited to 'util/oslib-win32.c')
1 files changed, 1 insertions, 4 deletions
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;
OpenPOWER on IntegriCloud