提交 ff3bd5e4 编写于 作者: L Luiz Capitulino 提交者: Michael Roth

exec: file_ram_alloc(): print error when prealloc fails

If memory allocation fails when using the -mem-prealloc command-line
option, QEMU exits without printing any error information to
the user:

 # qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages
 # echo $?
 1

This commit adds an error message, so that we print instead:

 # qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages
 qemu: unable to map backing store for hugepages: Cannot allocate memory
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
(cherry picked from commit e4d9df4f)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 d6af26d6
......@@ -1130,6 +1130,7 @@ static void *file_ram_alloc(RAMBlock *block,
error:
if (mem_prealloc) {
error_report("%s\n", error_get_pretty(*errp));
exit(1);
}
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册