On 23/1/23 13:09, Daniel P. Berrangé wrote:
On Mon, Jan 23, 2023 at 01:05:45PM +0100, Philippe Mathieu-Daudé wrote:
On 23/1/23 12:11, Daniel P. Berrangé wrote:
On Mon, Jan 23, 2023 at 10:20:29AM +0100, Philippe Mathieu-Daudé wrote:
On 23/1/23 09:39, Thomas Huth wrote:
From: Daniel P. Berrangé <berra...@redhat.com>

+AudiodevList *qmp_query_audiodevs(Error **errp)
+{
+    AudiodevList *ret = NULL;
+    AudiodevListEntry *e;
+    QSIMPLEQ_FOREACH(e, &audiodevs, next) {

I am a bit confused here, isn't &audiodevs containing what the user provided
from CLI? How is that useful to libvirt? Maybe the corner case
of a user hand-modifying the QEMU launch arguments from a XML config?

Wouldn't a list of linked in AudiodevDriver be more useful to libvirt
so it could pick the best available backend to start a VM?

On the libvirt side we're never going to need to actually call the
query-audiodevs commands. The mere existance of the command, means
that the QMP schema now exposes information about what audio backends
have been compiled into the binary. This is the same trick we've used
for other aspects of QMP. IOW we don't need a separate command just
for the purpose of listing AudiodevDrivers.

I understand having "what audio backends have been compiled into the
binary" is useful, but I am missing how you get that from &audiodevs.

AFAICT &audiodevs is for the CLI parsed backends, not all the backends
linked within a binary. I probably need sugar / coffee and will revisit
after lunch.

It ties into the 'query-qmp-schema' command, along with patch #2 in
this series.

The query-audiodevs command will cause the 'AudiodevDriver' enum to
be reported in the 'query-qmp-schema' response. Patch #2, makes all
the AudiodevDriver enum entries conditional on CONFIG_XXXX.

IOW now query-qmp-schema data will tell you what AudiodevDriver
backends are compiled into the binary you're talking to.

Thanks for the explanation Daniel.

Just FTR, while I'm not confident enough to add a R-b tag, I am
not opposed to it.

Regards,

Phil.

Reply via email to