qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RfC PATCH 08/15] virtio-gpu-pci: virtio-1.0 adaptions


From: Max Reitz
Subject: Re: [Qemu-devel] [RfC PATCH 08/15] virtio-gpu-pci: virtio-1.0 adaptions [fixup]
Date: Thu, 26 Feb 2015 11:46:53 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2015-02-23 at 05:23, Gerd Hoffmann wrote:
Signed-off-by: Gerd Hoffmann <address@hidden>
---
  hw/display/virtio-gpu-pci.c | 11 ++++-------
  1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index 77c5e06..791ee8b 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -28,10 +28,10 @@ static int virtio_gpu_pci_init(VirtIOPCIProxy *vpci_dev)
      DeviceState *vdev = DEVICE(&vgpu->vdev);
qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
-    if (qdev_init(vdev) < 0) {
-        return -1;
-    }
-    return 0;
+    /* force virtio-1.0 */
+    vpci_dev->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODERN;
+    vpci_dev->flags |= VIRTIO_PCI_FLAG_DISABLE_LEGACY;
+    return qdev_init(vdev);
  }
static void virtio_gpu_pci_class_init(ObjectClass *klass, void *data)
@@ -43,9 +43,6 @@ static void virtio_gpu_pci_class_init(ObjectClass *klass, 
void *data)
      set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
      dc->props = virtio_gpu_pci_properties;
      k->init = virtio_gpu_pci_init;
-    pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
-    pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_GPU;
-    pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;

So I guess this is the reason why you didn't update pci-ids.txt in patch 7.

This seems to be in line with the changes made in patch 1; however, I fail to see where VirtIODevice.device_id is set so that virtio_bus_get_vdev_id() returns it when called from virtio_pci_device_plugged()... Maybe I'll find it yet.

Max

      pcidev_k->class_id = PCI_CLASS_DISPLAY_OTHER;
  }




reply via email to

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