From patchwork Thu Jun 19 17:36:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 32234 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B48A1203F4 for ; Thu, 19 Jun 2014 17:39:52 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id o8sf7650211qcw.3 for ; Thu, 19 Jun 2014 10:39:52 -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:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=qlgdLkVrES0CqukBTApjZPrjOnYxMTOFv2RFRZYhTHs=; b=LTiYh6RIE2cmTiuQ1eL6PjaNjuWpbcocCFL/uq+DbPyB69mjZaTJktDaYz32ALkk7G PEXcJjpCzq8OuS0qw3up6BEioTX6y8O9sEpp9gmrqeuvjABKum2ywsffh5n1LY2YOVr+ G9hdLY5VUogoqwib/bZJNcnYA+9ribt9ojJ7c1OZ65M3kuFXrhAixhPb4JF0SA+1jpzX KB1vuZcWekFVcSYN5yxywiT4Vn8d2ratHDD4V88sA4LNHsy6ncfTImRphVp0ZLNZlgve cXE1fxLei/3o01GNxtwiUF7ih+ITi33zpnNkIoS6eVVAgEfpkr5c7PU/ul4TFRcWnlqH xv8A== X-Gm-Message-State: ALoCoQlFeXZn61OEF+QZj9KIiQ87sqsM0Vp66GT/6vslmDE09gb03s0aN/a0eMeG9TzRnn79PZTB X-Received: by 10.58.219.105 with SMTP id pn9mr2978769vec.30.1403199592513; Thu, 19 Jun 2014 10:39:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.37 with SMTP id g34ls638857qgd.64.gmail; Thu, 19 Jun 2014 10:39:52 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr5145200vco.25.1403199592439; Thu, 19 Jun 2014 10:39:52 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id cd10si2733477vcb.54.2014.06.19.10.39.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Jun 2014 10:39:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so2547563vcb.33 for ; Thu, 19 Jun 2014 10:39:52 -0700 (PDT) X-Received: by 10.52.52.168 with SMTP id u8mr4338495vdo.25.1403199592346; Thu, 19 Jun 2014 10:39:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp379126vcb; Thu, 19 Jun 2014 10:39:52 -0700 (PDT) X-Received: by 10.140.93.163 with SMTP id d32mr9237641qge.1.1403199591747; Thu, 19 Jun 2014 10:39:51 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 9si7485314qan.42.2014.06.19.10.39.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Jun 2014 10:39:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:36967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgJT-0004IJ-AF for patch@linaro.org; Thu, 19 Jun 2014 13:39:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgGr-0000rT-Bo for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxgGq-0004ux-K1 for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:09 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgGq-0004k9-Dp for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:08 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WxgGf-0002JP-Ri for qemu-devel@nongnu.org; Thu, 19 Jun 2014 18:36:57 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 19 Jun 2014 18:36:49 +0100 Message-Id: <1403199417-8833-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1403199417-8833-1-git-send-email-peter.maydell@linaro.org> References: <1403199417-8833-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 06/14] hw/arm/vexpress: Forbid specifying flash contents in two ways at once 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Detect attempts by the user to specify the contents of the first flash device via both -bios and -drive if=pflash... simultaneously and print a helpful error message. Signed-off-by: Peter Maydell Message-id: 1402419834-25982-1-git-send-email-peter.maydell@linaro.org --- 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);