From patchwork Fri Jun 26 13:31:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 50350 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 220B622902 for ; Fri, 26 Jun 2015 13:33:06 +0000 (UTC) Received: by lagx9 with SMTP id x9sf780064lag.2 for ; Fri, 26 Jun 2015 06:33:05 -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=qoRhCfScf//CFTkWShCXMoIHirkk0vGKF2950mXKjGw=; b=lCkP5yRGF6IixG2rUPB9W8CdZ4fkyVczT1aLVPfEHZL2dqnijOnOOmwZzVjfCgZhJm ELhNliygZdPX334geCsbXqRURZ1ljd0iwJYlydtaRy7vGbY4ocmXPnny7COWy8GsK2Ip bCUDJN2BJPrnGB4m9zHILiOF3agQV6Ty3+PKRBDYZQ3vEJQdJHNXjzZNe9eRNN8PsExX AkzGFxrh/MBOmHH/toa4XKsI00N/XJmAEzzwK3mV6rLcRynHc2m6b1+qf5nkEdMS12nS turC6pXn2561CVqGer5Si74g5ekj/SfLC6kMiGMzgdH3087y3hygrXOJjkkst0S7Eilc ZbtQ== X-Gm-Message-State: ALoCoQkRviAASBV533+n/eNP70Xx/zgR9bhGM7lTWljmApg274Qx8y1cil1q4CxK6vbkxFSAqER4 X-Received: by 10.112.200.163 with SMTP id jt3mr1120539lbc.17.1435325585120; Fri, 26 Jun 2015 06:33:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.227 with SMTP id lf3ls510184lab.93.gmail; Fri, 26 Jun 2015 06:33:04 -0700 (PDT) X-Received: by 10.152.30.4 with SMTP id o4mr1607112lah.74.1435325584709; Fri, 26 Jun 2015 06:33:04 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id j10si10657585lbp.23.2015.06.26.06.33.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 06:33:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by laar3 with SMTP id r3so1833457laa.0 for ; Fri, 26 Jun 2015 06:33:04 -0700 (PDT) X-Received: by 10.152.1.40 with SMTP id 8mr1687528laj.56.1435325584280; Fri, 26 Jun 2015 06:33:04 -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.112.108.230 with SMTP id hn6csp1330338lbb; Fri, 26 Jun 2015 06:33:03 -0700 (PDT) X-Received: by 10.141.28.147 with SMTP id f141mr2332343qhe.12.1435325582808; Fri, 26 Jun 2015 06:33:02 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w68si32863144qha.74.2015.06.26.06.33.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 26 Jun 2015 06:33:02 -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]:60006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Tkb-00049Y-WD for patch@linaro.org; Fri, 26 Jun 2015 09:33:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8TjF-0002Lh-Dp for qemu-devel@nongnu.org; Fri, 26 Jun 2015 09:31:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8TjA-0001WA-OJ for qemu-devel@nongnu.org; Fri, 26 Jun 2015 09:31:37 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8TjA-0001QX-HN for qemu-devel@nongnu.org; Fri, 26 Jun 2015 09:31:32 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Z8Tj2-0005Gr-AH for qemu-devel@nongnu.org; Fri, 26 Jun 2015 14:31:24 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 26 Jun 2015 14:31:23 +0100 Message-Id: <1435325484-20208-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1435325484-20208-1-git-send-email-peter.maydell@linaro.org> References: <1435325484-20208-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 7/7] hw/arm/virt: Make block devices default to virtio 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.215.47 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 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 succeed, but silently create a device with non-removable medium. this is probably not really what the user wants, but is the best we can do now. 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 have to be changed to include 'if=none', as the error message suggests. Signed-off-by: Peter Maydell Reviewed-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi Message-id: 1435068107-12594-4-git-send-email-peter.maydell@linaro.org --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 4e78083a..4846892 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -956,6 +956,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 = {