diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2014-09-08 13:50:05 -0400 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2014-12-24 15:43:39 -0600 |
commit | ff3bd5e4bbebe49e5e719bc83d894ff0990bc842 (patch) | |
tree | 4d37ca5ab901e2cfc3ffe7246bff3632ede5cf8d /exec.c | |
parent | d6af26d6ce544ef50d4114d573a59e54db31fa62 (diff) | |
download | qemu-ff3bd5e4bbebe49e5e719bc83d894ff0990bc842.tar.gz |
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: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit e4d9df4fb16861f413374b69fcdb12c8c7a4a17e)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |