qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Gerd Hoffmann" <kraxel@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Cc: libvir-list@redhat.com, smitterl@redhat.com,
	Eric Blake <eblake@redhat.com>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional
Date: Wed, 9 Jun 2021 14:01:49 +0200	[thread overview]
Message-ID: <16fdaf9e-e3ed-9de5-932c-3db33c6f77ee@redhat.com> (raw)
In-Reply-To: <20210609114921.mc4upvizeobfruaw@sirius.home.kraxel.org>

On 09/06/2021 13.49, Gerd Hoffmann wrote:
> On Wed, Jun 09, 2021 at 12:29:58PM +0100, Daniel P. Berrangé wrote:
>> On Wed, Jun 09, 2021 at 01:24:05PM +0200, Gerd Hoffmann wrote:
>>> On Wed, Jun 09, 2021 at 12:02:40PM +0200, Thomas Huth wrote:
>>>> 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.
>>>
>>> Hmm, that'll break for the "dnf remove qemu-ui-sdl" case ...
>>
>> Note tht libvirt invalidates its cache of QEMU capabilities when it
>> sees the /usr/lib64/qemu directory timestamp change. So it ought to
>> pick up changes caused by installing/removing QEMU modules, and apply
>> this to future queries for domcapabilities, or when starting future
>> QEMU guests.
> 
> That'll work fine for modules implementing qom objects / devices,
> because the list of available objects changes accordingly and libvirt
> can see that.
> 
> The #if CONFIG_SDL approach will not work because qemu will continue to
> report sdl as supported even when the sdl module is not installed any
> more.

I guess we'd need a separate QMP command to fix that, which tries to load 
the modules first when being called? Something similar to what is being done 
in qemu_display_help() ?
That's certainly doable, too, just a little bit more complex... do we want 
that? Or is the quick-n-easy way via the schema good enough for most use 
cases? (I'm not that familiar with "virsh domcapabilities" ... is there any 
real usage for the <graphics> section or is this rather cosmetical?)

  Thomas


PS: My CI runs with the patch just finished, and apparently I missed some 
#ifdefs in other parts of the code ... so I need to respin this patch 
anyway, no matter which direction we decide to go...



  parent reply	other threads:[~2021-06-09 12:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 10:02 [RFC QEMU PATCH] ui: Make the DisplayType enum entries conditional Thomas Huth
2021-06-09 11:24 ` Gerd Hoffmann
2021-06-09 11:29   ` Daniel P. Berrangé
2021-06-09 11:49     ` Gerd Hoffmann
2021-06-09 11:53       ` Daniel P. Berrangé
2021-06-09 12:01       ` Thomas Huth [this message]
2021-06-09 12:50         ` Gerd Hoffmann
2021-06-10  5:01           ` Markus Armbruster
2021-06-10  5:20           ` Thomas Huth
2021-06-09 13:11   ` Markus Armbruster
2021-06-09 13:16 ` Markus Armbruster
2021-06-09 14:36   ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16fdaf9e-e3ed-9de5-932c-3db33c6f77ee@redhat.com \
    --to=thuth@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=smitterl@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).