summaryrefslogtreecommitdiff
path: root/hw/display/virtio-gpu-pci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-06-24 12:19:42 +0200
committerGerd Hoffmann <kraxel@redhat.com>2015-07-07 11:23:17 +0200
commite18882952e46634ab7f53ef018a5e2e980996d48 (patch)
treef36bd90d1866519e63a80af14a50832f84afdc74 /hw/display/virtio-gpu-pci.c
parent5317b0f6d4bb581c5c8f88f31138ee301ad2b7e5 (diff)
virtio-gpu: update console device property.
Update the device link of the QemuConsole, so it points to the virtio-gpu-pci or virtio-vga device instead of virtio-gpu-device. This is needed because we want to find the device by id, for example for input routing, and the id specified on the command line is attached to the pci proxy, not the virtio device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/display/virtio-gpu-pci.c')
-rw-r--r--hw/display/virtio-gpu-pci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index f0f25c7bc9..d3e9aad128 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -25,13 +25,21 @@ static Property virtio_gpu_pci_properties[] = {
static void virtio_gpu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
{
VirtIOGPUPCI *vgpu = VIRTIO_GPU_PCI(vpci_dev);
+ VirtIOGPU *g = &vgpu->vdev;
DeviceState *vdev = DEVICE(&vgpu->vdev);
+ int i;
qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
/* force virtio-1.0 */
vpci_dev->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODERN;
vpci_dev->flags |= VIRTIO_PCI_FLAG_DISABLE_LEGACY;
object_property_set_bool(OBJECT(vdev), true, "realized", errp);
+
+ for (i = 0; i < g->conf.max_outputs; i++) {
+ object_property_set_link(OBJECT(g->scanout[i].con),
+ OBJECT(vpci_dev),
+ "device", errp);
+ }
}
static void virtio_gpu_pci_class_init(ObjectClass *klass, void *data)