qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 42/49] memory: exit when hugepage allocation fails if


From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 42/49] memory: exit when hugepage allocation fails if mem-prealloc
Date: Tue, 26 Jan 2016 14:47:14 +0100

From: Luiz Capitulino <address@hidden>

When -mem-prealloc is passed on the command-line, the expected
behavior is to exit if the hugepage allocation fails.  However,
this behavior is broken since commit cc57501dee which made
hugepage allocation fall back to regular ram in case of faliure.

This commit restores the expected behavior for -mem-prealloc.

Signed-off-by: Luiz Capitulino <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 numa.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/numa.c b/numa.c
index 425ef8d..23a5d83 100644
--- a/numa.c
+++ b/numa.c
@@ -418,12 +418,15 @@ static void allocate_system_memory_nonnuma(MemoryRegion 
*mr, Object *owner,
         Error *err = NULL;
         memory_region_init_ram_from_file(mr, owner, name, ram_size, false,
                                          mem_path, &err);
-
-        /* Legacy behavior: if allocation failed, fall back to
-         * regular RAM allocation.
-         */
         if (err) {
             error_report_err(err);
+            if (mem_prealloc) {
+                exit(1);
+            }
+
+            /* Legacy behavior: if allocation failed, fall back to
+             * regular RAM allocation.
+             */
             memory_region_init_ram(mr, owner, name, ram_size, &error_fatal);
         }
 #else
-- 
1.8.3.1





reply via email to

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