qemu: improve hugepage allocation failure message
PATCH 1/1 qemu: improve hugepage allocation failure message
Improve hugepage allocation failure message, indicating whats happening to the user.
exec.c +2 -1
@@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block, block->flags & RAM_SHARED);if (area ==MAP_FAILED ) {error_setg_errno (errp, errno, -"unable to map backing store for guest RAM" ); +"unable to map backing store for guest RAM, " +"falling back to malloc based RAM allocation" );return NULL ; }
Quoted 3 lines · Marcelo Tosatti
Improve hugepage allocation failure message, indicating whats happening to the user.
s/whats/what's/
Quoted 19 lines
Signed-off-by Marcelo Tosatti <[email protected]>exec.c +2
-1@@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block, block->flags & RAM_SHARED);if (area ==MAP_FAILED ) {error_setg_errno (errp, errno, -"unable to map backing store for guest RAM" ); +"unable to map backing store for guest RAM, " +"falling back to malloc based RAM allocation" );return NULL ; }
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Quoted 11 lines · Marcelo Tosatti
Improve hugepage allocation failure message, indicating whats happening to the user.
Signed-off-by Marcelo Tosatti <[email protected]>exec.c +0
-0
exec.c static void *file_ram_alloc(RAMBlock *block, · line 1650
Quoted 9 lines
exec.c +2
-1@@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block, block->flags & RAM_SHARED);if (area ==MAP_FAILED ) {error_setg_errno (errp, errno, -"unable to map backing store for guest RAM" ); +"unable to map backing store for guest RAM, " +"falling back to malloc based RAM allocation" );return NULL ; }
The backing store here is not always hugetlbfs, e.g., it can be NVDIMM and even regular files. In those cases, the failure of file_ram_alloc() does not fall back to malloc.
Haozhong
Quoted 17 lines · Haozhong Zhang
Quoted 16 lines · Marcelo Tosatti
Improve hugepage allocation failure message, indicating whats happening to the user.
Signed-off-by Marcelo Tosatti <[email protected]>exec.c +1
-1@@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block, block->flags & RAM_SHARED);if (area ==MAP_FAILED ) {error_setg_errno (errp, errno, -"unable to map backing store for guest RAM" ); + "unable to map backing store for guest RAM, "
Quoted 8 lines
exec.c static void *file_ram_alloc(RAMBlock *block, · line 1650
Quoted 4 lines
exec.c +1
-0+ "falling back to malloc based RAM allocation");return NULL ; }The backing store here is not always hugetlbfs, e.g., it can be NVDIMM and even regular files. In those cases, the failure of
file_ram_alloc()does not fall back to malloc.
It's also not happending if !mem_prealloc. Let's instead add an error_report in allocate_system_memory_nonnuma (and it's probably better to use MAP_ANON instead of malloc in the message).
Paolo