All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-block@nongnu.org, patches@linaro.org
Subject: [Qemu-devel] [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	[thread overview]
Message-ID: <1435068107-12594-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1435068107-12594-1-git-send-email-peter.maydell@linaro.org>

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 <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 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 = {
-- 
1.9.1

  parent reply	other threads:[~2015-06-23 14:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 14:01 [Qemu-devel] [PATCH v2 for-2.4 0/3] block: Improve warnings for doubly-connected drives Peter Maydell
2015-06-23 14:01 ` [Qemu-devel] [PATCH v2 for-2.4 1/3] qdev-properties-system: Change set_pointer's parse callback to use Error Peter Maydell
2015-06-23 14:01 ` [Qemu-devel] [PATCH v2 for-2.4 2/3] qdev-properties-system: Improve error message for drive assignment conflict Peter Maydell
2015-06-23 14:01 ` Peter Maydell [this message]
2015-06-25  7:40   ` [Qemu-devel] [PATCH v2 for-2.4 3/3] hw/arm/virt: Make block devices default to virtio Markus Armbruster
2015-06-25  9:04     ` Peter Maydell
2015-06-25  9:25       ` Markus Armbruster
2015-06-25  9:26 ` [Qemu-devel] [PATCH v2 for-2.4 0/3] block: Improve warnings for doubly-connected drives Markus Armbruster
2015-06-25  9:35   ` Peter Maydell
2015-06-25 10:49     ` Markus Armbruster
2015-06-25 13:23       ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-06-25 13:23 ` [Qemu-devel] " Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435068107-12594-4-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=patches@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.