aboutsummaryrefslogtreecommitdiff
path: root/hw/display/virtio-vga.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-vga.c
parent5317b0f6d4bb581c5c8f88f31138ee301ad2b7e5 (diff)
downloadqemu-e18882952e46634ab7f53ef018a5e2e980996d48.zip
qemu-e18882952e46634ab7f53ef018a5e2e980996d48.tar.gz
qemu-e18882952e46634ab7f53ef018a5e2e980996d48.tar.bz2
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-vga.c')
-rw-r--r--hw/display/virtio-vga.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 94f9d0e..1b09a04 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -79,6 +79,7 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
VirtIOGPU *g = &vvga->vdev;
VGACommonState *vga = &vvga->vga;
uint32_t offset;
+ int i;
/* init vga compat bits */
vga->vram_size_mb = 8;
@@ -120,6 +121,12 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
vga->con = g->scanout[0].con;
graphic_console_set_hwops(vga->con, &virtio_vga_ops, vvga);
+
+ 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_vga_reset(DeviceState *dev)