[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional
From: |
Markus Armbruster |
Subject: |
Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional |
Date: |
Wed, 09 Jun 2021 15:16:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Thomas Huth <thuth@redhat.com> writes:
> Libvirt's "domcapabilities" command has a way to state whether
> certain graphic frontends are available in QEMU or not. Originally,
> libvirt looked at the "--help" output of the QEMU binary to determine
> whether SDL was available or not (by looking for the "-sdl" parameter
> in the help text), but since libvirt stopped doing this analysis of
> the help text, the detection of SDL is currently broken, see:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1790902
>
> QEMU should provide a way via the QMP interface instead. The simplest
> way, without introducing additional commands, is to make the DisplayType
> enum entries conditional, so that the enum only contains the entries if
> the corresponding CONFIG_xxx switches have been set. Unfortunately, this
> only works for sdl, cocoa and spice, since gtk, egl-headless and curses
> are hard-wired in the "data" section of the DisplayOptions, and thus
> unfortunately always have to be defined.
Here:
{ 'union' : 'DisplayOptions',
'base' : { 'type' : 'DisplayType',
'*full-screen' : 'bool',
'*window-close' : 'bool',
'*show-cursor' : 'bool',
'*gl' : 'DisplayGLMode' },
'discriminator' : 'type',
'data' : { 'gtk' : 'DisplayGTK',
'curses' : 'DisplayCurses',
'egl-headless' : 'DisplayEGLHeadless'} }
Flat union branches can be made conditional like so:
'data' : { 'gtk' : { 'type': 'DisplayGTK',
'if': 'defined(CONFIG_GTK)' },
Then you should be able to make the corresponding enum value
conditional, too.
- [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Thomas Huth, 2021/06/09
- Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Gerd Hoffmann, 2021/06/09
- Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Daniel P . Berrangé, 2021/06/09
- Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Gerd Hoffmann, 2021/06/09
- Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Daniel P . Berrangé, 2021/06/09
- Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Thomas Huth, 2021/06/09
- Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Gerd Hoffmann, 2021/06/09
- Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Markus Armbruster, 2021/06/10
- Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Thomas Huth, 2021/06/10
Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional, Markus Armbruster, 2021/06/09
Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional,
Markus Armbruster <=