if an error occurs initializing hugetables and mem prealloc is enabled
qemu exits silently without dumping the error.

Signed-off-by: Peter Lieven <p...@kamp.de>
---
 exec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/exec.c b/exec.c
index 765bd94..8123186 100644
--- a/exec.c
+++ b/exec.c
@@ -34,6 +34,7 @@
 #include "qemu/timer.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
+#include "qapi/qmp/qerror.h"
 #include "exec/memory.h"
 #include "sysemu/dma.h"
 #include "exec/address-spaces.h"
@@ -1095,6 +1096,9 @@ static void *file_ram_alloc(RAMBlock *block,
 
 error:
     if (mem_prealloc) {
+        if (*errp) {
+            qerror_report_err(*errp);
+        }
         exit(1);
     }
     return NULL;
-- 
1.7.9.5


Reply via email to