qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/5] qdev/compat: virtio-blk-pci 0.10 compatibil


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 3/5] qdev/compat: virtio-blk-pci 0.10 compatibility.
Date: Thu, 09 Jul 2009 17:09:41 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

On 07/09/09 16:52, Michael S. Tsirkin wrote:
      .compat_props = (CompatProperty[]) {
+        {
+            .driver   = "virtio-blk-pci",
+            .property = "class",
+            .value    = "0x0180", /* PCI_CLASS_STORAGE_OTHER */

it seems annoying that we can't use the symbolic name. Ideas how to fix this?

We could add a special property type instead of using hex32. Then we can have a string <-> int mapping and use something like

             .value = "storage-other",

Not sure it is worth the trouble though.

-
-    uint16_t vendor;
-    uint16_t device;
-    uint16_t subvendor;
-    uint16_t class_code;
-    uint8_t pif;

Are the other fields unused? If yes can be a separate patch ...

Yes, they are all unused to date.  This patch puts class_code into use.

+    if (proxy->class_code != PCI_CLASS_STORAGE_SCSI&&
+        proxy->class_code != PCI_CLASS_STORAGE_OTHER)
+        proxy->class_code = PCI_CLASS_STORAGE_SCSI;
+

what does this do?

Make sure proxy->class_code has one of the two allowed values.

      vdev = virtio_blk_init(&pci_dev->qdev);
      virtio_init_pci(proxy, vdev,
                      PCI_VENDOR_ID_REDHAT_QUMRANET,
                      PCI_DEVICE_ID_VIRTIO_BLOCK,
-                    PCI_CLASS_STORAGE_OTHER,
-                    0x00);
+                    proxy->class_code, 0x00);
  }

  static void virtio_console_init_pci(PCIDevice *pci_dev)

does this mean that virtio block was broken by some previous
patch? It's not a good way to split changes: bisecting won't work.

Huh?  virtio block wasn't broken.  What makes you think it was?

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]