Message ID | 1551413588-36475-1-git-send-email-08005325@163.com |
---|---|
State | New |
Headers | show |
Series | Fix coredump when using virtio-vga | expand |
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c index bdcd33c..59b571d 100644 --- a/hw/display/virtio-gpu-pci.c +++ b/hw/display/virtio-gpu-pci.c @@ -46,6 +46,11 @@ static void virtio_gpu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) int i; Error *local_error = NULL; + if (g->conf.max_outputs <= 0) { + qemu_log("WARNING: virtio gpu max_outputs must greater than 1"); + g->conf.max_outputs = 1; + } + qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus)); virtio_pci_force_virtio_1(vpci_dev); object_property_set_bool(OBJECT(vdev), true, "realized", &local_error);