From patchwork Mon Apr 29 14:52:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominik Dingel X-Patchwork-Id: 240385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 973042C00A1 for ; Tue, 30 Apr 2013 00:53:02 +1000 (EST) Received: from localhost ([::1]:42437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWpRr-0007kl-00 for incoming@patchwork.ozlabs.org; Mon, 29 Apr 2013 10:52:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWpRJ-0007ij-5D for qemu-devel@nongnu.org; Mon, 29 Apr 2013 10:52:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWpRA-0002VQ-Ll for qemu-devel@nongnu.org; Mon, 29 Apr 2013 10:52:25 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:46976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWpRA-0002TF-Co for qemu-devel@nongnu.org; Mon, 29 Apr 2013 10:52:16 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Apr 2013 15:48:28 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 29 Apr 2013 15:48:26 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1188517D801B for ; Mon, 29 Apr 2013 15:53:14 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3TEq3W838469754 for ; Mon, 29 Apr 2013 14:52:03 GMT Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3TEqC8k029550 for ; Mon, 29 Apr 2013 08:52:13 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r3TEqCEs029520; Mon, 29 Apr 2013 08:52:12 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 2944) id F2347122442E; Mon, 29 Apr 2013 16:52:11 +0200 (CEST) From: Dominik Dingel To: qemu-devel@nongnu.org Date: Mon, 29 Apr 2013 16:52:05 +0200 Message-Id: <1367247128-22409-3-git-send-email-dingel@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.1.6 In-Reply-To: <1367247128-22409-1-git-send-email-dingel@linux.vnet.ibm.com> References: <1367247128-22409-1-git-send-email-dingel@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13042914-3548-0000-0000-0000053DD9D5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.112 Cc: Christian Borntraeger , Alexander Graf , Dominik Dingel Subject: [Qemu-devel] [PATCH v2 2/5] S390: BIOS check for file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add a check if the BIOS blob exists before trying to load. Signed-off-by: Dominik Dingel diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index bcbba7c..f7a570e 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -93,6 +93,10 @@ static int s390_ipl_init(SysBusDevice *dev) } bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + if (bios_filename == NULL) { + hw_error("could not find stage1 bootloader\n"); + } + bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL, NULL, 1, ELF_MACHINE, 0); if (bios_size == -1UL) {