[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix coredump when using virtio-vga
|
From: |
Gerd Hoffmann |
|
Subject: |
Re: [Qemu-devel] [PATCH] Fix coredump when using virtio-vga |
|
Date: |
Fri, 1 Mar 2019 07:05:51 +0100 |
|
User-agent: |
NeoMutt/20180716 |
On Fri, Mar 01, 2019 at 12:13:08PM +0800, address@hidden wrote:
> From: Michael Qiu <address@hidden>
>
> When using command -device virtio-vga,virgl=on
> the default max_outputs is 0, this will lead coredump,
The default is 1.
> @@ -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;
> + }
There already is a sanity check in virtio_gpu_device_realize().
You can extend that to also throw an error in case max_outputs
is 0. Fixing things up and continuing is a bad idea. Yes there
are places in the qemu code base still doing that, for backward
compatibility with old versions, but we should not add new
instances of this.
cheers,
Gerd