qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 5/5] qdev/compat: virtio-net-pci 0.10 compatibility.
Date: Thu,  9 Jul 2009 15:02:33 +0200	[thread overview]
Message-ID: <1247144553-8951-6-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1247144553-8951-1-git-send-email-kraxel@redhat.com>


Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/pc.c         |    4 ++++
 hw/virtio-pci.c |   13 ++++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 0b7c24b..ecb618d 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1471,6 +1471,10 @@ static QEMUMachine pc_machine_v0_10 = {
             .driver   = "virtio-console-pci",
             .property = "class",
             .value    = "0x0380", /* PCI_CLASS_DISPLAY_OTHER */
+        },{
+            .driver   = "virtio-net-pci",
+            .property = "msi",
+            .value    = "0",
         },
         { /* end of list */ }
     },
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 9e5343d..d284621 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -87,6 +87,7 @@ typedef struct {
     VirtIODevice *vdev;
     uint32_t addr;
     uint32_t class_code;
+    uint32_t msi;
 } VirtIOPCIProxy;
 
 /* virtio device */
@@ -387,7 +388,8 @@ static void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev,
 
     config[0x3d] = 1;
 
-    if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors, 1, 0)) {
+    if (vdev->nvectors && proxy->msi &&
+        !msix_init(&proxy->pci_dev, vdev->nvectors, 1, 0)) {
         pci_register_bar(&proxy->pci_dev, 1,
                          msix_bar_size(&proxy->pci_dev),
                          PCI_ADDRESS_SPACE_MEM,
@@ -487,6 +489,15 @@ static PCIDeviceInfo virtio_info[] = {
         .qdev.size  = sizeof(VirtIOPCIProxy),
         .qdev.class = DEV_CLASS_NETWORK,
         .init       = virtio_net_init_pci,
+        .qdev.props = (Property[]) {
+            {
+                .name   = "msi",
+                .info   = &qdev_prop_uint32,
+                .offset = offsetof(VirtIOPCIProxy, msi),
+                .defval = (uint32_t[]) { 1 }, /* enabled */
+            },
+            {/* end of list */}
+        },
     },{
         .qdev.name = "virtio-console-pci",
         .qdev.size = sizeof(VirtIOPCIProxy),
-- 
1.6.2.5

  parent reply	other threads:[~2009-07-09 13:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-09 13:02 [Qemu-devel] [PATCH 0/5] qdev: compat properties Gerd Hoffmann
2009-07-09 13:02 ` [Qemu-devel] [PATCH 1/5] qdev/compat: compat property infrastructure Gerd Hoffmann
2009-07-09 13:02 ` [Qemu-devel] [PATCH 2/5] qdev/compat: add pc-0.10 machine type Gerd Hoffmann
2009-07-09 13:02 ` [Qemu-devel] [PATCH 3/5] qdev/compat: virtio-blk-pci 0.10 compatibility Gerd Hoffmann
2009-07-09 14:52   ` Michael S. Tsirkin
2009-07-09 15:09     ` Gerd Hoffmann
2009-07-09 18:20       ` Michael S. Tsirkin
2009-07-09 19:42         ` Filip Navara
2009-07-09 19:45           ` Michael S. Tsirkin
2009-07-09 15:50     ` Anthony Liguori
2009-07-09 13:02 ` [Qemu-devel] [PATCH 4/5] qdev/compat: virtio-balloon-pci " Gerd Hoffmann
2009-07-09 13:02 ` Gerd Hoffmann [this message]
2009-07-09 14:40   ` [Qemu-devel] [PATCH 5/5] qdev/compat: virtio-net-pci " Michael S. Tsirkin
2009-07-09 15:17     ` Gerd Hoffmann

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=1247144553-8951-6-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --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 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).