[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/3] Change default PCI class of virtio-blk to PCI_C
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH 1/3] Change default PCI class of virtio-blk to PCI_CLASS_STORAGE_SCSI |
Date: |
Tue, 07 Jul 2009 12:09:10 +0100 |
Windows virtio driver cannot pass DTM (certification) tests while the
storage class is PCI_CLASS_STORAGE_UNKNOWN.
A new qdev type is introduced to allow devices using the old class
to be created for compatibility with qemu-0.10.x.
Reported-by: Dor Laor <address@hidden>
Signed-off-by: Mark McLoughlin <address@hidden>
---
hw/virtio-pci.c | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index f7da503..93ee5e1 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -414,7 +414,8 @@ static void virtio_init_pci(VirtIOPCIProxy *proxy,
VirtIODevice *vdev,
virtio_bind_device(vdev, &virtio_pci_bindings, proxy);
}
-static void virtio_blk_init_pci(PCIDevice *pci_dev)
+static void virtio_blk_init_pci_with_class(PCIDevice *pci_dev,
+ uint16_t class_code)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
VirtIODevice *vdev;
@@ -423,8 +424,17 @@ static void virtio_blk_init_pci(PCIDevice *pci_dev)
virtio_init_pci(proxy, vdev,
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_BLOCK,
- PCI_CLASS_STORAGE_OTHER,
- 0x00);
+ class_code, 0x00);
+}
+
+static void virtio_blk_init_pci(PCIDevice *pci_dev)
+{
+ virtio_blk_init_pci_with_class(pci_dev, PCI_CLASS_STORAGE_SCSI);
+}
+
+static void virtio_blk_init_pci_0_10(PCIDevice *pci_dev)
+{
+ virtio_blk_init_pci_with_class(pci_dev, PCI_CLASS_STORAGE_OTHER);
}
static void virtio_console_init_pci(PCIDevice *pci_dev)
@@ -476,6 +486,10 @@ static void virtio_pci_register_devices(void)
virtio_console_init_pci);
pci_qdev_register("virtio-balloon-pci", sizeof(VirtIOPCIProxy),
virtio_balloon_init_pci);
+
+ /* For compatibility with 0.10 */
+ pci_qdev_register("virtio-blk-pci-0-10", sizeof(VirtIOPCIProxy),
+ virtio_blk_init_pci_0_10);
}
device_init(virtio_pci_register_devices)
--
1.6.2.5
- [Qemu-devel] [PATCH 0/3] Change virtio blk/console PCI classes and introduce compat machine type [was Re: Configuration vs. compat hints], Mark McLoughlin, 2009/07/07
- [Qemu-devel] [PATCH 1/3] Change default PCI class of virtio-blk to PCI_CLASS_STORAGE_SCSI,
Mark McLoughlin <=
- [Qemu-devel] [PATCH 2/3] Change default PCI class of virtio-console to PCI_CLASS_SERIAL_OTHER, Mark McLoughlin, 2009/07/07
- [Qemu-devel] [PATCH 3/3] Add a pc-0-10 machine type for compatibility with 0.10.x, Mark McLoughlin, 2009/07/07
- Re: [Qemu-devel] [PATCH 3/3] Add a pc-0-10 machine type for compatibility with 0.10.x, Avi Kivity, 2009/07/07
- Re: [Qemu-devel] [PATCH 3/3] Add a pc-0-10 machine type for compatibility with 0.10.x, Mark McLoughlin, 2009/07/08
- [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x, Mark McLoughlin, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x, Gerd Hoffmann, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x, Anthony Liguori, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x, Gerd Hoffmann, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x, Mark McLoughlin, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x, Gerd Hoffmann, 2009/07/08