From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaPg7-0003Yk-Qt for qemu-devel@nongnu.org; Fri, 11 Sep 2015 10:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaPg4-0002HM-Kr for qemu-devel@nongnu.org; Fri, 11 Sep 2015 10:51:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaPg4-0002H1-F7 for qemu-devel@nongnu.org; Fri, 11 Sep 2015 10:51:48 -0400 From: Markus Armbruster Date: Fri, 11 Sep 2015 16:51:44 +0200 Message-Id: <1441983105-26376-4-git-send-email-armbru@redhat.com> In-Reply-To: <1441983105-26376-1-git-send-email-armbru@redhat.com> References: <1441983105-26376-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 3/4] loader: Fix memory_region_init_resizeable_ram() error handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, peter.crosthwaite@xilinx.com, hutao@cn.fujitsu.com Commit ef701d7 screwed up handling of out-of-memory conditions. Before the commit, we report the error and exit(1), in one place. The commit lifts the error handling up the call chain some, to three places. Fine. Except it uses &error_abort in these places, changing the behavior from exit(1) to abort(), and thus undoing the work of commit 3922825 "exec: Don't abort when we can't allocate guest memory". The previous commit fixed up uses of memory_region_init_ram(). One of them was replaced by memory_region_init_resizeable_ram() [sic!] in commit a166614, so Coccinelle missed it. Fix it up. Signed-off-by: Markus Armbruster --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 216eeeb..3b29881 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -741,7 +741,7 @@ static void *rom_set_mr(Rom *rom, Object *owner, const char *name) memory_region_init_resizeable_ram(rom->mr, owner, name, rom->datasize, rom->romsize, fw_cfg_resized, - &error_abort); + &error_fatal); memory_region_set_readonly(rom->mr, true); vmstate_register_ram_global(rom->mr); -- 2.4.3