From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoVb5-00079v-DT for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:00:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoVb0-0007YH-CS for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:00:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoVaz-0007Xd-QK for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:00:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id CD420C0AF799 for ; Tue, 20 Oct 2015 12:00:48 +0000 (UTC) References: <1445274671-17704-1-git-send-email-imammedo@redhat.com> From: Paolo Bonzini Message-ID: <56262CEC.2030107@redhat.com> Date: Tue, 20 Oct 2015 14:00:44 +0200 MIME-Version: 1.0 In-Reply-To: <1445274671-17704-1-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [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: Igor Mammedov , qemu-devel@nongnu.org On 19/10/2015 19:11, Igor Mammedov wrote: > 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 > Queued, thanks. Paolo