From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOtGy-0002Fa-Ml for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOtGr-0002AK-Cb for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:47 -0400 Received: from [199.232.76.173] (port=42390 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOtGr-0002A1-1e for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:41 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54506) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOtGq-0002DJ-Bo for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:40 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n69D2dUt016263 for ; Thu, 9 Jul 2009 09:02:39 -0400 From: Gerd Hoffmann Date: Thu, 9 Jul 2009 15:02:33 +0200 Message-Id: <1247144553-8951-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1247144553-8951-1-git-send-email-kraxel@redhat.com> References: <1247144553-8951-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 5/5] qdev/compat: virtio-net-pci 0.10 compatibility. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- 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