From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XR3x2-0003JY-RB for qemu-devel@nongnu.org; Mon, 08 Sep 2014 14:46:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XR3ww-0002us-7k for qemu-devel@nongnu.org; Mon, 08 Sep 2014 14:46:08 -0400 Date: Mon, 8 Sep 2014 14:08:26 -0400 From: Luiz Capitulino Message-ID: <20140908140826.3a673423@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] exec: file_ram_alloc(): print error when prealloc fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: peter.maydell@linaro.org, mtosatti@redhat.com, qemu-stable@nongnu.org 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 --- 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