From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9GzD-00038R-Lm for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9Gz3-00061M-Sw for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:07 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:35008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Gz3-00061B-LE for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:34:57 -0500 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Jan 2015 10:34:57 -0700 From: Michael Roth Date: Thu, 8 Jan 2015 11:33:07 -0600 Message-Id: <1420738472-23267-4-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 03/88] exec: file_ram_alloc(): print error when prealloc fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Luiz Capitulino 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 Reviewed-by: Eric Blake (cherry picked from commit e4d9df4fb16861f413374b69fcdb12c8c7a4a17e) Signed-off-by: Michael Roth --- exec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/exec.c b/exec.c index 307bc24..a7d7daa 100644 --- a/exec.c +++ b/exec.c @@ -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; -- 1.9.1