From patchwork Tue Jun 23 14:01:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 50225 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D591521575 for ; Tue, 23 Jun 2015 14:01:58 +0000 (UTC) Received: by lbcui10 with SMTP id ui10sf3183874lbc.0 for ; Tue, 23 Jun 2015 07:01:57 -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:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=j4yBxus6zztnrXiSd1jbWyLzYXEn6ZUoGtSiZZPIO8c=; b=GJYOHf9C9DYB7yFVefAGvTL7h0Biw5sFyag6+zAX12kIFWZIxvYlCuIqq0J5M8ajIZ Tl8dqN1PkB5FG9hn8n/uKeeDPKvxt38ofKk0sJbqwrEWEkjVO09dvCec70Anw5Sux9Ji bm8Brjqui/LLa5/+yRMukD3nMqRpD5zivky1kcOkHANPPkPwSZpqEvB7uL+5wD7JmoRI O22QcJvkooS7dccKdLoFXf9Pc7iWPOc9yU5ZzS3Xh50/ICg++mnm3LK9DZyzcrLHQ0K9 b5LSaqLoii48cBvyQi12W9nX0Q+VmbIFOchpd5qeEILcyMgOJj4waCGuo9tzFJM3Re5m OKCw== X-Gm-Message-State: ALoCoQnV/2lqv3SsPsVf9kwcpGJ0xoJ0O7vhl4/MFk88ilJTWYlXswqOgT+bkJRqHKZgyW75jwbt X-Received: by 10.194.236.230 with SMTP id ux6mr29449461wjc.5.1435068117832; Tue, 23 Jun 2015 07:01:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.202 with SMTP id d10ls54231laa.69.gmail; Tue, 23 Jun 2015 07:01:57 -0700 (PDT) X-Received: by 10.152.238.39 with SMTP id vh7mr34900270lac.71.1435068117672; Tue, 23 Jun 2015 07:01:57 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id lb7si18094939lac.114.2015.06.23.07.01.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 07:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbnk3 with SMTP id k3so7341065lbn.1 for ; Tue, 23 Jun 2015 07:01:57 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr34809778lay.72.1435068117440; Tue, 23 Jun 2015 07:01:57 -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.112.108.230 with SMTP id hn6csp3096888lbb; Tue, 23 Jun 2015 07:01:55 -0700 (PDT) X-Received: by 10.70.48.34 with SMTP id i2mr69731263pdn.125.1435068114991; Tue, 23 Jun 2015 07:01:54 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id rm13si31609929pab.133.2015.06.23.07.01.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 23 Jun 2015 07:01:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Z7Oln-0003Hn-HJ; Tue, 23 Jun 2015 15:01:47 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Markus Armbruster , Kevin Wolf , qemu-block@nongnu.org Subject: [PATCH v2 for-2.4 3/3] hw/arm/virt: Make block devices default to virtio Date: Tue, 23 Jun 2015 15:01:47 +0100 Message-Id: <1435068107-12594-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1435068107-12594-1-git-send-email-peter.maydell@linaro.org> References: <1435068107-12594-1-git-send-email-peter.maydell@linaro.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.217.170 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: , Now we have virtio-pci, we can make the virt board's default block device type be IF_VIRTIO. This allows users to use simplified command lines that don't have to explicitly create virtio-pci-blk devices; the -hda &c very short options now also work. This means we also need to set no_cdrom to avoid getting a default cdrom device -- this is needed because the virtio-blk device will fail if it is connected to a block backend with no media, which is what the default cdrom device typically is. Providing a cdrom with media via -cdrom will still work. Note that this change means that some command lines which used to work (by accident) will stop working. Where a drive was connected manually to a device but without 'if=none' being specified, we used to treat this as an IDE drive, which we would then not autoplug because the board doesn't support IDE. Now we will treat it as a virtio disk and autoplug it, which means the attempt to use the drive manually will fail: qemu-system-arm: -drive file=img.qcow2,id=foo: Drive 'foo' is already in use because it has been automatically connected to another device (did you need 'if=none' in the drive options?) The command line will be changed to include 'if=none', as the error message suggests. Signed-off-by: Peter Maydell --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index f1e85c8..7e643ba 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -966,6 +966,8 @@ static void virt_class_init(ObjectClass *oc, void *data) mc->init = machvirt_init; mc->max_cpus = 8; mc->has_dynamic_sysbus = true; + mc->block_default_type = IF_VIRTIO; + mc->no_cdrom = 1; } static const TypeInfo machvirt_info = {