From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSXQc-0008Vv-20 for qemu-devel@nongnu.org; Fri, 12 Sep 2014 16:26:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSXQV-0005jB-Ua for qemu-devel@nongnu.org; Fri, 12 Sep 2014 16:26:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSXQV-0005j6-N0 for qemu-devel@nongnu.org; Fri, 12 Sep 2014 16:26:39 -0400 From: Luiz Capitulino Date: Fri, 12 Sep 2014 16:26:24 -0400 Message-Id: <1410553584-25048-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1410553584-25048-1-git-send-email-lcapitulino@redhat.com> References: <1410553584-25048-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PULL 2/2] exec: file_ram_alloc(): print error when prealloc fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws 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 --- exec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/exec.c b/exec.c index 7dddcc8..cb73d16 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.3