[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
- [Qemu-devel] [PULL 34/49] scripts/kvm/kvm_stat: Fix output formatting, (continued)
- [Qemu-devel] [PULL 34/49] scripts/kvm/kvm_stat: Fix output formatting, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 33/49] scripts/kvm/kvm_stat: Make tui function a class, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 37/49] scripts/kvm/kvm_stat: Fix rlimit for unprivileged users, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 38/49] scripts/kvm/kvm_stat: Fixup filtering, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 32/49] scripts/kvm/kvm_stat: Remove unneeded X86_EXIT_REASONS, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 35/49] scripts/kvm/kvm_stat: Cleanup and pre-init perf_event_attr, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 40/49] scripts/kvm/kvm_stat: Add optparse description, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 41/49] cpus: use broadcast on qemu_pause_cond, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 39/49] scripts/kvm/kvm_stat: Add interactive filtering, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 43/49] nbd: add missed aio_context_acquire in nbd_export_new, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 42/49] memory: exit when hugepage allocation fails if mem-prealloc,
Paolo Bonzini <=
- [Qemu-devel] [PULL 45/49] scripts/dump-guest-memory.py: Make methods functions, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 46/49] scripts/dump-guest-memory.py: Improve python 3 compatibility, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 47/49] scripts/dump-guest-memory.py: Cleanup functions, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 44/49] scripts/dump-guest-memory.py: Move constants to the top, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 48/49] scripts/dump-guest-memory.py: Introduce multi-arch support, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 49/49] scripts/dump-guest-memory.py: Fix module docstring, Paolo Bonzini, 2016/01/26
- Re: [Qemu-devel] [PULL 00/49] chardev, NBD, cpus, scripts/ changes for 2015-01-26, Peter Maydell, 2016/01/26