qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 2/2] exec: file_ram_alloc(): print error when preallo


From: Luiz Capitulino
Subject: [Qemu-devel] [PULL 2/2] exec: file_ram_alloc(): print error when prealloc fails
Date: Fri, 12 Sep 2014 16:26:24 -0400

If memory allocation fails when using the -mem-prealloc command-line
option, QEMU exits without printing any error information to
the user:

 # qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages
 # echo $?
 1

This commit adds an error message, so that we print instead:

 # qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages
 qemu: unable to map backing store for hugepages: Cannot allocate memory

Signed-off-by: Luiz Capitulino <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
 exec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/exec.c b/exec.c
index 7dddcc8..cb73d16 100644
--- a/exec.c
+++ b/exec.c
@@ -1130,6 +1130,7 @@ static void *file_ram_alloc(RAMBlock *block,
 
 error:
     if (mem_prealloc) {
+        error_report("%s\n", error_get_pretty(*errp));
         exit(1);
     }
     return NULL;
-- 
1.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]