[PATCH 2/5] qemu: Adapt to virtio-gpu-gl-pci device when available
Peter Krempa
pkrempa at redhat.com
Tue Jun 8 14:19:56 UTC 2021
On Tue, Jun 08, 2021 at 16:14:36 +0200, Michal Prívozník wrote:
> On 6/8/21 3:15 AM, Han Han wrote:
> > QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property
> > of virtio-gpu-pci device. Adapt to that change.
> >
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967356
> >
> > Signed-off-by: Han Han <hhan at redhat.com>
> > ---
> > src/qemu/qemu_command.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> > index 4ed82ed570..a79e96a121 100644
> > --- a/src/qemu/qemu_command.c
> > +++ b/src/qemu/qemu_command.c
> > @@ -546,7 +546,11 @@ qemuBuildVirtioDevStr(virBuffer *buf,
> > return -1;
> > }
> >
> > - virBufferAsprintf(buf, "%s-%s", baseName, implName);
> > + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) &&
> > + STREQ(baseName, "virtio-gpu"))
> > + virBufferAsprintf(buf, "%s-gl-%s", baseName, implName);
> > + else
> > + virBufferAsprintf(buf, "%s-%s", baseName, implName);
>
> This doesn't look right. What if domain has:
>
> <acceleration accel3d='no'/>
>
> This will still pick virtio-gpu-gl-pci, wouldn't it? I think we need to
> pick the correct model beforehand and leave qemuBuildVirtioDevStr()
> unmodified.
Definitely. Ideally the command line formatter itself should never do
any form of logic of picking the models or device types which could have
ABI impact.
More information about the libvir-list
mailing list