From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z81lc-0008P6-52 for qemu-devel@nongnu.org; Thu, 25 Jun 2015 03:40:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z81la-0003hI-Qo for qemu-devel@nongnu.org; Thu, 25 Jun 2015 03:40:12 -0400 From: Markus Armbruster References: <1435068107-12594-1-git-send-email-peter.maydell@linaro.org> <1435068107-12594-4-git-send-email-peter.maydell@linaro.org> Date: Thu, 25 Jun 2015 09:40:00 +0200 In-Reply-To: <1435068107-12594-4-git-send-email-peter.maydell@linaro.org> (Peter Maydell's message of "Tue, 23 Jun 2015 15:01:47 +0100") Message-ID: <878ub844of.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 for-2.4 3/3] hw/arm/virt: Make block devices default to virtio List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org, patches@linaro.org Peter Maydell writes: > 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. It'll create a virtio-blk device with non-removable medium, won't it? > 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 will have to be changed > 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 = {