From patchwork Tue Jun 10 17:03:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 31687 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1362420675 for ; Tue, 10 Jun 2014 17:04:00 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id l13sf18118053iga.3 for ; Tue, 10 Jun 2014 10:03:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=bQu6Ga+EPVQ2LBvD7Tr4/3GJJk4/s6oqa2RK4kfxdDA=; b=RDlvbc36gINnyU3fIoXTu2Te5n7e/Vh/hUHzzmAYAPm+RqrvEgSyv5tD03dzYFTNCM QRFN8iJGXaac9vnZB0BI2i6XSTHOry2jlKa6QU/G+Dq1xskbfDuiQqb+DPvY0sB+86DA HMoFI68ELkzMuAHrX11RtXJUIHEDu471zhatr44gxBCL70M5eSNn4kliBh7OzojyY5vc SYJ8lak1xhbe8gVOEVA7MaJNc4TTzssPYnrk5fddYUHe9igsGeX7P7T//i9Pc51H8nDO xcQo+1VK/aw9WVYs4BwqF9R6Tt3Hg8EzWDZpVnrqWZUT68jvZO9Siui884VLMHZmtu/E GH1Q== X-Gm-Message-State: ALoCoQnp5VwaRm3xOWSkywn43CAik2Vslfw5emfUjt3ku28f2LN7pDQM8qIpu36911m+RS+MNNz7 X-Received: by 10.42.19.73 with SMTP id a9mr3274873icb.31.1402419839568; Tue, 10 Jun 2014 10:03:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.195 with SMTP id f61ls2118457qgf.59.gmail; Tue, 10 Jun 2014 10:03:59 -0700 (PDT) X-Received: by 10.52.159.226 with SMTP id xf2mr28196953vdb.14.1402419838471; Tue, 10 Jun 2014 10:03:58 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id t13si13295026vek.64.2014.06.10.10.03.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 10:03:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so584025vcb.7 for ; Tue, 10 Jun 2014 10:03:58 -0700 (PDT) X-Received: by 10.58.29.198 with SMTP id m6mr33426249veh.15.1402419838315; Tue, 10 Jun 2014 10:03:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp240966vcb; Tue, 10 Jun 2014 10:03:57 -0700 (PDT) X-Received: by 10.180.93.234 with SMTP id cx10mr40221812wib.18.1402419837451; Tue, 10 Jun 2014 10:03:57 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ek1si17751859wib.66.2014.06.10.10.03.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 10:03:57 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WuPSk-0006lX-W0; Tue, 10 Jun 2014 18:03:55 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini Subject: [PATCH] hw/arm/vexpress: Forbid specifying flash contents in two ways at once Date: Tue, 10 Jun 2014 18:03:54 +0100 Message-Id: <1402419834-25982-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Detect attempts by the user to specify the contents fo the first flash device via both -bios and -drive if=pflash... simultaneously and print a helpful error message. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- This rules out a nonsensical combination and matches what we're going to do with the 'virt' machine. hw/arm/vexpress.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index f311595..3d83e6c 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -533,7 +533,15 @@ static void vexpress_common_init(VEDBoardInfo *daughterboard, * If a bios file was provided, attempt to map it into memory */ if (bios_name) { - const char *fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + const char *fn; + + if (drive_get(IF_PFLASH, 0, 0)) { + error_report("The contents of the first flash device may be " + "specified with -bios or with -drive if=pflash... " + "but you cannot use both options at once"); + exit(1); + } + fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (!fn || load_image_targphys(fn, map[VE_NORFLASH0], VEXPRESS_FLASH_SIZE) < 0) { error_report("Could not load ROM image '%s'", bios_name);