From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoDxv-0005Hq-Ak for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:11:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoDxr-0005MQ-7t for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:11:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoDxr-0005ME-2s for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:11:15 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 86DB419CF6D for ; Mon, 19 Oct 2015 17:11:14 +0000 (UTC) From: Igor Mammedov Date: Mon, 19 Oct 2015 19:11:11 +0200 Message-Id: <1445274671-17704-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH] file_ram_alloc: propagate error to caller instead of terminating QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com QEMU shouldn't exits from file_ram_alloc() if -mem-prealloc option is specified and "object_add memory-backend-file,..." fails allocation during memory hotplug. Propagate error to a caller and let it decide what to do with allocation failure. That leaves QEMU alive if it can't create backend during hotplug time and kills QEMU at startup time if backends or initial memory were misconfigured/ too large. Signed-off-by: Igor Mammedov --- exec.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/exec.c b/exec.c index 7d90a52..0aadd41 100644 --- a/exec.c +++ b/exec.c @@ -1292,10 +1292,6 @@ static void *file_ram_alloc(RAMBlock *block, return area; error: - if (mem_prealloc) { - error_report("%s", error_get_pretty(*errp)); - exit(1); - } return NULL; } #endif -- 1.8.3.1