qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, aurelien@aurel32.net, rth@twiddle.net
Subject: [Qemu-devel] [PATCH 02/19] virtio: use generic name when possible
Date: Tue, 29 Mar 2011 15:29:29 +0200	[thread overview]
Message-ID: <1301405386-25738-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1301405386-25738-1-git-send-email-agraf@suse.de>

We have two different virtio buses: pci and s390. The abstraction path
taken in qemu is to have generic aliases for each device type in the
architecture specific qdev devices.

So let's make use of these aliases whenever we can and define them
whenever we can.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 blockdev.c           |    2 +-
 hw/s390-virtio-bus.c |    2 ++
 hw/virtio-pci.c      |    3 +++
 vl.c                 |    6 +++---
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index ecf2252..bbe92fe 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -503,7 +503,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
     case IF_VIRTIO:
         /* add virtio block device */
         opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0);
-        qemu_opt_set(opts, "driver", "virtio-blk-pci");
+        qemu_opt_set(opts, "driver", "virtio-blk");
         qemu_opt_set(opts, "drive", dinfo->id);
         if (devaddr)
             qemu_opt_set(opts, "addr", devaddr);
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 784dc01..d44eff2 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -325,6 +325,7 @@ static const VirtIOBindings virtio_s390_bindings = {
 static VirtIOS390DeviceInfo s390_virtio_net = {
     .init = s390_virtio_net_init,
     .qdev.name = "virtio-net-s390",
+    .qdev.alias = "virtio-net",
     .qdev.size = sizeof(VirtIOS390Device),
     .qdev.props = (Property[]) {
         DEFINE_NIC_PROPERTIES(VirtIOS390Device, nic),
@@ -340,6 +341,7 @@ static VirtIOS390DeviceInfo s390_virtio_net = {
 static VirtIOS390DeviceInfo s390_virtio_blk = {
     .init = s390_virtio_blk_init,
     .qdev.name = "virtio-blk-s390",
+    .qdev.alias = "virtio-blk",
     .qdev.size = sizeof(VirtIOS390Device),
     .qdev.props = (Property[]) {
         DEFINE_BLOCK_PROPERTIES(VirtIOS390Device, block),
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index df10703..555f23f 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -873,6 +873,7 @@ static PCIDeviceInfo virtio_info[] = {
         .qdev.reset = virtio_pci_reset,
     },{
         .qdev.name  = "virtio-net-pci",
+        .qdev.alias = "virtio-net",
         .qdev.size  = sizeof(VirtIOPCIProxy),
         .init       = virtio_net_init_pci,
         .exit       = virtio_net_exit_pci,
@@ -911,6 +912,7 @@ static PCIDeviceInfo virtio_info[] = {
         .qdev.reset = virtio_pci_reset,
     },{
         .qdev.name = "virtio-balloon-pci",
+        .qdev.alias = "virtio-balloon",
         .qdev.size = sizeof(VirtIOPCIProxy),
         .init      = virtio_balloon_init_pci,
         .exit      = virtio_exit_pci,
@@ -922,6 +924,7 @@ static PCIDeviceInfo virtio_info[] = {
     },{
 #ifdef CONFIG_VIRTFS
         .qdev.name = "virtio-9p-pci",
+        .qdev.alias = "virtio-9p",
         .qdev.size = sizeof(VirtIOPCIProxy),
         .init      = virtio_9p_init_pci,
         .qdev.props = (Property[]) {
diff --git a/vl.c b/vl.c
index 192a240..462c2e3 100644
--- a/vl.c
+++ b/vl.c
@@ -1687,7 +1687,7 @@ static int balloon_parse(const char *arg)
             /* create empty opts */
             opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0);
         }
-        qemu_opt_set(opts, "driver", "virtio-balloon-pci");
+        qemu_opt_set(opts, "driver", "virtio-balloon");
         return 0;
     }
 
@@ -2573,12 +2573,12 @@ int main(int argc, char **argv, char **envp)
                          qemu_opt_get(opts, "path"),
                          qemu_opt_get(opts, "security_model"));
 
-                len = strlen("virtio-9p-pci,fsdev=,mount_tag=");
+                len = strlen("virtio-9p,fsdev=,mount_tag=");
                 len += 2*strlen(qemu_opt_get(opts, "mount_tag"));
                 arg_9p = qemu_malloc((len + 1) * sizeof(*arg_9p));
 
                 snprintf(arg_9p, (len + 1) * sizeof(*arg_9p),
-                         "virtio-9p-pci,fsdev=%s,mount_tag=%s",
+                         "virtio-9p,fsdev=%s,mount_tag=%s",
                          qemu_opt_get(opts, "mount_tag"),
                          qemu_opt_get(opts, "mount_tag"));
 
-- 
1.6.0.2

  parent reply	other threads:[~2011-03-29 13:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 13:29 [Qemu-devel] [PATCH 00/19] s390x emulation support Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 01/19] Only build ivshmem when CONFIG_PCI && CONFIG_KVM Alexander Graf
2011-03-29 13:29 ` Alexander Graf [this message]
2011-03-29 13:29 ` [Qemu-devel] [PATCH 03/19] s390x: fix KVM target Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 04/19] s390x: fix s390-virtio-serial Alexander Graf
2011-03-29 14:17   ` [Qemu-devel] " Amit Shah
2011-03-29 13:29 ` [Qemu-devel] [PATCH 05/19] s390x: Enable disassembler for s390x Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 06/19] s390x: Enable nptl " Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 07/19] s390x: enable CPU_QuadU Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 08/19] s390x: s390x-linux-user support Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 09/19] linux-user: define a couple of syscalls for non-uid16 targets Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 10/19] s390x: Enable s390x-softmmu target Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 11/19] s390x: Dispatch interrupts to KVM or the real CPU Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 12/19] s390x: Adjust GDB stub Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 13/19] s390x: virtio machine storage keys Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 14/19] s390x: Prepare cpu.h for emulation Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 15/19] s390x: helper functions for system emulation Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 16/19] s390x: Implement opcode helpers Alexander Graf
2011-03-29 16:13   ` [Qemu-devel] " Richard Henderson
2011-03-29 16:25     ` Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 17/19] s390x: Adjust internal kvm code Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 18/19] s390x: translate engine for s390x CPU Alexander Graf
2011-03-29 13:29 ` [Qemu-devel] [PATCH 19/19] s390x: build s390x by default Alexander Graf
2011-03-30 10:23 ` [Qemu-devel] Re: [PATCH 00/19] s390x emulation support Peter Maydell
2011-03-30 10:46   ` Alexander Graf
2011-03-30 15:14     ` Peter Maydell
2011-04-03 22:37 ` [Qemu-devel] " Aurelien Jarno
2011-04-03 22:43   ` Alexander Graf
2011-04-04  9:29     ` Alexander Graf

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=1301405386-25738-3-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).