Skip to content
Snippets Groups Projects
Commit fae947b0 authored by Luiz Capitulino's avatar Luiz Capitulino Committed by Paolo Bonzini
Browse files

memory: exit when hugepage allocation fails if mem-prealloc


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 cc57501d 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: default avatarLuiz Capitulino <lcapitulino@redhat.com>
Message-Id: <20160122091501.75bbd42a@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 96bce683
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment