From patchwork Mon Dec 14 15:07:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 41112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 919ABB6F01 for ; Tue, 15 Dec 2009 02:22:41 +1100 (EST) Received: from localhost ([127.0.0.1]:41726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKCkw-0007sY-Gs for incoming@patchwork.ozlabs.org; Mon, 14 Dec 2009 10:22:38 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKCWn-0008Id-Dg for qemu-devel@nongnu.org; Mon, 14 Dec 2009 10:08:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKCWi-0008Cu-Gp for qemu-devel@nongnu.org; Mon, 14 Dec 2009 10:08:00 -0500 Received: from [199.232.76.173] (port=58184 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKCWi-0008Cj-9L for qemu-devel@nongnu.org; Mon, 14 Dec 2009 10:07:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48527) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKCWh-0008SZ-Q1 for qemu-devel@nongnu.org; Mon, 14 Dec 2009 10:07:56 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBEF7sND021634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Dec 2009 10:07:54 -0500 Received: from zweiblum.home.kraxel.org (vpn1-6-28.ams2.redhat.com [10.36.6.28]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBEF7qwP002403; Mon, 14 Dec 2009 10:07:53 -0500 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id B46F470FB4; Mon, 14 Dec 2009 16:07:38 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 14 Dec 2009 16:07:35 +0100 Message-Id: <1260803255-23943-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [FOR 0.12 PATCH v2] Check rom_load_all() return value. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Check rom_load_all() return value. Also don't make option rom loading failure fatal. Signed-off-by: Gerd Hoffmann --- hw/loader.c | 2 +- vl.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/loader.c b/hw/loader.c index 2d7a2c4..89491a2 100644 --- a/hw/loader.c +++ b/hw/loader.c @@ -669,7 +669,7 @@ int rom_load_all(void) "addr 0x" TARGET_FMT_plx ", size 0x%zx, max 0x" TARGET_FMT_plx ")\n", rom->name, addr, rom->romsize, rom->max); - return -1; + continue; } } else { /* fixed address requested */ diff --git a/vl.c b/vl.c index fd70caa..fd93a94 100644 --- a/vl.c +++ b/vl.c @@ -6049,7 +6049,10 @@ int main(int argc, char **argv, char **envp) qdev_machine_creation_done(); - rom_load_all(); + if (rom_load_all() != 0) { + fprintf(stderr, "rom loading failed\n"); + exit(1); + } qemu_system_reset(); if (loadvm) {