[libvirt] [PATCH 03/12] qemu: caps: Start probing for egl-headless display type

Peter Krempa pkrempa at redhat.com
Thu Nov 22 17:38:25 UTC 2018


On Thu, Nov 22, 2018 at 17:36:01 +0100, Erik Skultety wrote:
> QEMU 3.1 introduced the 'query-display-options' QMP command which in
> itself isn't of any use to us since it can only provide information
> during runtime as the information is based on what appears on the
> cmdline. However, just by having the command in place allows us to
> introspect the @DisplayOptions data type in the QAPI schema.
> 
> This patch implements the proper way of checking for the 'egl-headless'
> display capability. Unfortunately, we can't get rid of the old code
> which set the capability based on a specific QEMU (2.10) version just
> yet as that would break backwards compatibility.
> 
> Signed-off-by: Erik Skultety <eskultet at redhat.com>
> ---
>  src/qemu/qemu_capabilities.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index fde27010e4..90b76db034 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -1248,6 +1248,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
>      { "screendump/arg-type/device", QEMU_CAPS_SCREENDUMP_DEVICE },
>      { "block-commit/arg-type/*top",  QEMU_CAPS_ACTIVE_COMMIT },
>      { "query-iothreads/ret-type/poll-max-ns", QEMU_CAPS_IOTHREAD_POLLING },
> +    { "query-display-options/ret-type/+egl-headless", QEMU_CAPS_EGL_HEADLESS },
>  };
>  
>  typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;
> @@ -4122,11 +4123,6 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
>          virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
>      }
>  
> -    /* '-display egl-headless' cmdline option is supported since QEMU 2.10, but
> -     * there's no way to probe it */
> -    if (qemuCaps->version >= 2010000)
> -        virQEMUCapsSet(qemuCaps, QEMU_CAPS_EGL_HEADLESS);
> -
>      /* no way to query for -numa dist */
>      if (qemuCaps->version >= 2010000)
>          virQEMUCapsSet(qemuCaps, QEMU_CAPS_NUMA_DIST);
> @@ -4212,6 +4208,15 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
>              virQEMUCapsClear(qemuCaps, QEMU_CAPS_SEV_GUEST);
>      }
>  
> +    /* '-display egl-headless' cmdline option is supported since QEMU 2.10, but
> +     * until QEMU 3.1 there hasn't been a way to probe it
> +     *
> +     * NOTE: One day in a future far far away, we can ditch this check
> +     */
> +    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS) &&
> +        qemuCaps->version >= 2010000)
> +        virQEMUCapsSet(qemuCaps, QEMU_CAPS_EGL_HEADLESS);

I don't see much point in this patch and much less with the comment
above. The point where that code can be deleted is when 2.10 becomes
unsupported by libvirt. At that point the capability can always be
assumed and we don't need to gate it on the presence of that field.

This just adds some more code while the net result is the same.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20181122/1980fe1e/attachment-0001.sig>


More information about the libvir-list mailing list