[PATCH 0/3] domain capabilites improvements

Jim Fehlig posted 3 patches 1 year, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220906204251.16044-1-jfehlig@suse.com
There is a newer version of this series
docs/formatdomaincaps.rst                     | 46 +++++++++++++++++++
src/conf/domain_capabilities.c                | 26 +++++++++++
src/conf/domain_capabilities.h                | 16 +++++++
src/conf/schemas/domaincaps.rng               | 20 ++++++++
src/qemu/qemu_capabilities.c                  | 35 +++++++++++++-
src/qemu/qemu_capabilities.h                  |  6 +++
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  | 12 +++++
.../qemu_4.2.0-virt.aarch64.xml               |  7 +++
tests/domaincapsdata/qemu_4.2.0.aarch64.xml   |  7 +++
tests/domaincapsdata/qemu_4.2.0.ppc64.xml     |  7 +++
tests/domaincapsdata/qemu_4.2.0.s390x.xml     | 11 +++++
tests/domaincapsdata/qemu_4.2.0.x86_64.xml    | 12 +++++
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  | 12 +++++
.../qemu_5.0.0-virt.aarch64.xml               |  7 +++
tests/domaincapsdata/qemu_5.0.0.aarch64.xml   |  7 +++
tests/domaincapsdata/qemu_5.0.0.ppc64.xml     |  7 +++
tests/domaincapsdata/qemu_5.0.0.x86_64.xml    | 12 +++++
.../domaincapsdata/qemu_5.1.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  | 12 +++++
tests/domaincapsdata/qemu_5.1.0.sparc.xml     | 12 +++++
tests/domaincapsdata/qemu_5.1.0.x86_64.xml    | 12 +++++
.../domaincapsdata/qemu_5.2.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  | 12 +++++
.../qemu_5.2.0-virt.aarch64.xml               |  7 +++
tests/domaincapsdata/qemu_5.2.0.aarch64.xml   |  7 +++
tests/domaincapsdata/qemu_5.2.0.ppc64.xml     |  7 +++
tests/domaincapsdata/qemu_5.2.0.s390x.xml     | 11 +++++
tests/domaincapsdata/qemu_5.2.0.x86_64.xml    | 12 +++++
.../domaincapsdata/qemu_6.0.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml  | 12 +++++
.../qemu_6.0.0-virt.aarch64.xml               |  7 +++
tests/domaincapsdata/qemu_6.0.0.aarch64.xml   |  7 +++
tests/domaincapsdata/qemu_6.0.0.s390x.xml     | 11 +++++
tests/domaincapsdata/qemu_6.0.0.x86_64.xml    | 12 +++++
.../domaincapsdata/qemu_6.1.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml  | 12 +++++
tests/domaincapsdata/qemu_6.1.0.x86_64.xml    | 12 +++++
.../domaincapsdata/qemu_6.2.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml  | 12 +++++
.../qemu_6.2.0-virt.aarch64.xml               | 12 +++++
tests/domaincapsdata/qemu_6.2.0.aarch64.xml   | 12 +++++
tests/domaincapsdata/qemu_6.2.0.ppc64.xml     |  7 +++
tests/domaincapsdata/qemu_6.2.0.x86_64.xml    | 12 +++++
.../domaincapsdata/qemu_7.0.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml  | 12 +++++
.../qemu_7.0.0-virt.aarch64.xml               | 12 +++++
tests/domaincapsdata/qemu_7.0.0.aarch64.xml   | 12 +++++
tests/domaincapsdata/qemu_7.0.0.ppc64.xml     | 11 +++++
tests/domaincapsdata/qemu_7.0.0.x86_64.xml    | 12 +++++
.../domaincapsdata/qemu_7.1.0-q35.x86_64.xml  | 12 +++++
.../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml  | 12 +++++
tests/domaincapsdata/qemu_7.1.0.x86_64.xml    | 12 +++++
.../caps_4.2.0.x86_64.xml                     |  1 +
.../caps_5.0.0.riscv64.xml                    |  1 +
.../caps_5.0.0.x86_64.xml                     |  1 +
.../qemucapabilitiesdata/caps_5.1.0.sparc.xml |  1 +
.../caps_5.1.0.x86_64.xml                     |  1 +
.../caps_5.2.0.riscv64.xml                    |  1 +
.../caps_5.2.0.x86_64.xml                     |  1 +
.../caps_6.0.0.x86_64.xml                     |  1 +
.../caps_6.1.0.x86_64.xml                     |  1 +
.../caps_6.2.0.aarch64.xml                    |  1 +
.../caps_6.2.0.x86_64.xml                     |  1 +
.../caps_7.0.0.aarch64.xml                    |  1 +
.../caps_7.0.0.x86_64.xml                     |  1 +
.../caps_7.1.0.x86_64.xml                     |  1 +
68 files changed, 674 insertions(+), 1 deletion(-)
[PATCH 0/3] domain capabilites improvements
Posted by Jim Fehlig 1 year, 8 months ago
The first two patches add USB redirect and channel devices to
domcapabilities. Patch3 fixes reporting of spice support.

Patch1 was sent previously, before I noticed the others were needed

https://listman.redhat.com/archives/libvir-list/2022-August/234045.html

Jim Fehlig (3):
  conf: Add USB redirect devices to domain capabilities
  conf: Add channel devices to domain capabilities
  qemu: Use command line to properly check for spice support

 docs/formatdomaincaps.rst                     | 46 +++++++++++++++++++
 src/conf/domain_capabilities.c                | 26 +++++++++++
 src/conf/domain_capabilities.h                | 16 +++++++
 src/conf/schemas/domaincaps.rng               | 20 ++++++++
 src/qemu/qemu_capabilities.c                  | 35 +++++++++++++-
 src/qemu/qemu_capabilities.h                  |  6 +++
 .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  | 12 +++++
 .../qemu_4.2.0-virt.aarch64.xml               |  7 +++
 tests/domaincapsdata/qemu_4.2.0.aarch64.xml   |  7 +++
 tests/domaincapsdata/qemu_4.2.0.ppc64.xml     |  7 +++
 tests/domaincapsdata/qemu_4.2.0.s390x.xml     | 11 +++++
 tests/domaincapsdata/qemu_4.2.0.x86_64.xml    | 12 +++++
 .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  | 12 +++++
 .../qemu_5.0.0-virt.aarch64.xml               |  7 +++
 tests/domaincapsdata/qemu_5.0.0.aarch64.xml   |  7 +++
 tests/domaincapsdata/qemu_5.0.0.ppc64.xml     |  7 +++
 tests/domaincapsdata/qemu_5.0.0.x86_64.xml    | 12 +++++
 .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  | 12 +++++
 tests/domaincapsdata/qemu_5.1.0.sparc.xml     | 12 +++++
 tests/domaincapsdata/qemu_5.1.0.x86_64.xml    | 12 +++++
 .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  | 12 +++++
 .../qemu_5.2.0-virt.aarch64.xml               |  7 +++
 tests/domaincapsdata/qemu_5.2.0.aarch64.xml   |  7 +++
 tests/domaincapsdata/qemu_5.2.0.ppc64.xml     |  7 +++
 tests/domaincapsdata/qemu_5.2.0.s390x.xml     | 11 +++++
 tests/domaincapsdata/qemu_5.2.0.x86_64.xml    | 12 +++++
 .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml  | 12 +++++
 .../qemu_6.0.0-virt.aarch64.xml               |  7 +++
 tests/domaincapsdata/qemu_6.0.0.aarch64.xml   |  7 +++
 tests/domaincapsdata/qemu_6.0.0.s390x.xml     | 11 +++++
 tests/domaincapsdata/qemu_6.0.0.x86_64.xml    | 12 +++++
 .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml  | 12 +++++
 tests/domaincapsdata/qemu_6.1.0.x86_64.xml    | 12 +++++
 .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml  | 12 +++++
 .../qemu_6.2.0-virt.aarch64.xml               | 12 +++++
 tests/domaincapsdata/qemu_6.2.0.aarch64.xml   | 12 +++++
 tests/domaincapsdata/qemu_6.2.0.ppc64.xml     |  7 +++
 tests/domaincapsdata/qemu_6.2.0.x86_64.xml    | 12 +++++
 .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml  | 12 +++++
 .../qemu_7.0.0-virt.aarch64.xml               | 12 +++++
 tests/domaincapsdata/qemu_7.0.0.aarch64.xml   | 12 +++++
 tests/domaincapsdata/qemu_7.0.0.ppc64.xml     | 11 +++++
 tests/domaincapsdata/qemu_7.0.0.x86_64.xml    | 12 +++++
 .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml  | 12 +++++
 .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml  | 12 +++++
 tests/domaincapsdata/qemu_7.1.0.x86_64.xml    | 12 +++++
 .../caps_4.2.0.x86_64.xml                     |  1 +
 .../caps_5.0.0.riscv64.xml                    |  1 +
 .../caps_5.0.0.x86_64.xml                     |  1 +
 .../qemucapabilitiesdata/caps_5.1.0.sparc.xml |  1 +
 .../caps_5.1.0.x86_64.xml                     |  1 +
 .../caps_5.2.0.riscv64.xml                    |  1 +
 .../caps_5.2.0.x86_64.xml                     |  1 +
 .../caps_6.0.0.x86_64.xml                     |  1 +
 .../caps_6.1.0.x86_64.xml                     |  1 +
 .../caps_6.2.0.aarch64.xml                    |  1 +
 .../caps_6.2.0.x86_64.xml                     |  1 +
 .../caps_7.0.0.aarch64.xml                    |  1 +
 .../caps_7.0.0.x86_64.xml                     |  1 +
 .../caps_7.1.0.x86_64.xml                     |  1 +
 68 files changed, 674 insertions(+), 1 deletion(-)

-- 
2.37.1
Re: [PATCH 0/3] domain capabilites improvements
Posted by Jim Fehlig 1 year, 7 months ago
On 9/6/22 14:42, Jim Fehlig wrote:
> The first two patches add USB redirect and channel devices to
> domcapabilities. Patch3 fixes reporting of spice support.

Hi All!

Any comments on this series?

Regards,
Jim

> 
> Patch1 was sent previously, before I noticed the others were needed
> 
> https://listman.redhat.com/archives/libvir-list/2022-August/234045.html
> 
> Jim Fehlig (3):
>    conf: Add USB redirect devices to domain capabilities
>    conf: Add channel devices to domain capabilities
>    qemu: Use command line to properly check for spice support
> 
>   docs/formatdomaincaps.rst                     | 46 +++++++++++++++++++
>   src/conf/domain_capabilities.c                | 26 +++++++++++
>   src/conf/domain_capabilities.h                | 16 +++++++
>   src/conf/schemas/domaincaps.rng               | 20 ++++++++
>   src/qemu/qemu_capabilities.c                  | 35 +++++++++++++-
>   src/qemu/qemu_capabilities.h                  |  6 +++
>   .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  | 12 +++++
>   .../qemu_4.2.0-virt.aarch64.xml               |  7 +++
>   tests/domaincapsdata/qemu_4.2.0.aarch64.xml   |  7 +++
>   tests/domaincapsdata/qemu_4.2.0.ppc64.xml     |  7 +++
>   tests/domaincapsdata/qemu_4.2.0.s390x.xml     | 11 +++++
>   tests/domaincapsdata/qemu_4.2.0.x86_64.xml    | 12 +++++
>   .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  | 12 +++++
>   .../qemu_5.0.0-virt.aarch64.xml               |  7 +++
>   tests/domaincapsdata/qemu_5.0.0.aarch64.xml   |  7 +++
>   tests/domaincapsdata/qemu_5.0.0.ppc64.xml     |  7 +++
>   tests/domaincapsdata/qemu_5.0.0.x86_64.xml    | 12 +++++
>   .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  | 12 +++++
>   tests/domaincapsdata/qemu_5.1.0.sparc.xml     | 12 +++++
>   tests/domaincapsdata/qemu_5.1.0.x86_64.xml    | 12 +++++
>   .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  | 12 +++++
>   .../qemu_5.2.0-virt.aarch64.xml               |  7 +++
>   tests/domaincapsdata/qemu_5.2.0.aarch64.xml   |  7 +++
>   tests/domaincapsdata/qemu_5.2.0.ppc64.xml     |  7 +++
>   tests/domaincapsdata/qemu_5.2.0.s390x.xml     | 11 +++++
>   tests/domaincapsdata/qemu_5.2.0.x86_64.xml    | 12 +++++
>   .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml  | 12 +++++
>   .../qemu_6.0.0-virt.aarch64.xml               |  7 +++
>   tests/domaincapsdata/qemu_6.0.0.aarch64.xml   |  7 +++
>   tests/domaincapsdata/qemu_6.0.0.s390x.xml     | 11 +++++
>   tests/domaincapsdata/qemu_6.0.0.x86_64.xml    | 12 +++++
>   .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml  | 12 +++++
>   tests/domaincapsdata/qemu_6.1.0.x86_64.xml    | 12 +++++
>   .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml  | 12 +++++
>   .../qemu_6.2.0-virt.aarch64.xml               | 12 +++++
>   tests/domaincapsdata/qemu_6.2.0.aarch64.xml   | 12 +++++
>   tests/domaincapsdata/qemu_6.2.0.ppc64.xml     |  7 +++
>   tests/domaincapsdata/qemu_6.2.0.x86_64.xml    | 12 +++++
>   .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml  | 12 +++++
>   .../qemu_7.0.0-virt.aarch64.xml               | 12 +++++
>   tests/domaincapsdata/qemu_7.0.0.aarch64.xml   | 12 +++++
>   tests/domaincapsdata/qemu_7.0.0.ppc64.xml     | 11 +++++
>   tests/domaincapsdata/qemu_7.0.0.x86_64.xml    | 12 +++++
>   .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml  | 12 +++++
>   .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml  | 12 +++++
>   tests/domaincapsdata/qemu_7.1.0.x86_64.xml    | 12 +++++
>   .../caps_4.2.0.x86_64.xml                     |  1 +
>   .../caps_5.0.0.riscv64.xml                    |  1 +
>   .../caps_5.0.0.x86_64.xml                     |  1 +
>   .../qemucapabilitiesdata/caps_5.1.0.sparc.xml |  1 +
>   .../caps_5.1.0.x86_64.xml                     |  1 +
>   .../caps_5.2.0.riscv64.xml                    |  1 +
>   .../caps_5.2.0.x86_64.xml                     |  1 +
>   .../caps_6.0.0.x86_64.xml                     |  1 +
>   .../caps_6.1.0.x86_64.xml                     |  1 +
>   .../caps_6.2.0.aarch64.xml                    |  1 +
>   .../caps_6.2.0.x86_64.xml                     |  1 +
>   .../caps_7.0.0.aarch64.xml                    |  1 +
>   .../caps_7.0.0.x86_64.xml                     |  1 +
>   .../caps_7.1.0.x86_64.xml                     |  1 +
>   68 files changed, 674 insertions(+), 1 deletion(-)
>
Re: [PATCH 0/3] domain capabilites improvements
Posted by Jim Fehlig 1 year, 7 months ago
On 9/6/22 14:42, Jim Fehlig wrote:
> The first two patches add USB redirect and channel devices to
> domcapabilities. Patch3 fixes reporting of spice support.
> 
> Patch1 was sent previously, before I noticed the others were needed

Another capability I'd like to expose is the functionality provided by qemu's 
audio-spice module, which IIUC is essentially `-audiodev spice`. After peeking 
at the qmp ref manual [1] I expected to find an "audiodev" object, however

# virsh qemu-monitor-command test \
   --cmd '{"execute":"qom-list-types"}' | grep -i audiodev
#
# virsh qemu-monitor-command test --cmd \
   '{"execute":"qom-list-properties","arguments":{"typename":"audiodev"}}'
{"id":"libvirt-411","error":{"class":"DeviceNotFound","desc":"Class 'audiodev' 
not found"}}
# virsh qemu-monitor-command test --cmd \
   '{"execute":"device-list-properties","arguments":{"typename":"audiodev"}}'
{"id":"libvirt-412","error":{"class":"DeviceNotFound","desc":"Device 'audiodev' 
not found"}}

Command line help is not available either, which spawned Claudio's qemu patch [2]

# qemu-system-x86_64 -audiodev help
qemu-system-x86_64: -audiodev help: Help is not available for this option

Have I overlooked alternatives for detecting `-audiodev spice` support?

Thanks!
Jim

[1] https://qemu-project.gitlab.io/qemu/interop/qemu-qmp-ref.html#qapidoc-3005
[2] https://lists.gnu.org/archive/html/qemu-devel/2022-09/msg01181.html
Re: [PATCH 0/3] domain capabilites improvements
Posted by Peter Krempa 1 year, 7 months ago
On Wed, Sep 07, 2022 at 15:20:44 -0600, Jim Fehlig wrote:
> On 9/6/22 14:42, Jim Fehlig wrote:
> > The first two patches add USB redirect and channel devices to
> > domcapabilities. Patch3 fixes reporting of spice support.
> > 
> > Patch1 was sent previously, before I noticed the others were needed
> 
> Another capability I'd like to expose is the functionality provided by
> qemu's audio-spice module, which IIUC is essentially `-audiodev spice`.
> After peeking at the qmp ref manual [1] I expected to find an "audiodev"
> object, however
> 
> # virsh qemu-monitor-command test \
>   --cmd '{"execute":"qom-list-types"}' | grep -i audiodev
> #
> # virsh qemu-monitor-command test --cmd \
>   '{"execute":"qom-list-properties","arguments":{"typename":"audiodev"}}'
> {"id":"libvirt-411","error":{"class":"DeviceNotFound","desc":"Class
> 'audiodev' not found"}}
> # virsh qemu-monitor-command test --cmd \
>   '{"execute":"device-list-properties","arguments":{"typename":"audiodev"}}'
> {"id":"libvirt-412","error":{"class":"DeviceNotFound","desc":"Device
> 'audiodev' not found"}}
> 
> Command line help is not available either, which spawned Claudio's qemu patch [2]
> 
> # qemu-system-x86_64 -audiodev help
> qemu-system-x86_64: -audiodev help: Help is not available for this option

In cases where a command line option parser in qemu was implemented via
the modern QOM based approach, but at the same time is not runtime
configurable or queryable via the monitor it's not possible for libvirt
to detect the options.

Historically command line arguments could be queried via
'query-command-line-options' command but that was deemed to be
un-extendible and new code is not getting coverage. At the same time
libvirt is trying to decrease the reliance on the command to allow
deprecation and promote some form of replacement.

We had a similar problem for graphics options, which was side-stepped by
implementing 'query-display-options' which in turn exposed all the
objects in the QMP schema (query-qmp-schema) which allowed us to detet
graphics related functionality.

At this point we e.g. assume that the modern -audiodev is present. For
few specific configs we validate that the appropriate graphics protocol
is used for the VM but don't validate anything else.

For your specific query, the spice backend for audio is allowed only
when spice video is enabled anyways, so the capability you are
suggesting does not seem to be that much interesting as the decision can
be based on the graphics protocol support.
Re: [PATCH 0/3] domain capabilites improvements
Posted by Jim Fehlig 1 year, 7 months ago
On 9/8/22 01:52, Peter Krempa wrote:
> On Wed, Sep 07, 2022 at 15:20:44 -0600, Jim Fehlig wrote:
>> On 9/6/22 14:42, Jim Fehlig wrote:
>>> The first two patches add USB redirect and channel devices to
>>> domcapabilities. Patch3 fixes reporting of spice support.
>>>
>>> Patch1 was sent previously, before I noticed the others were needed
>>
>> Another capability I'd like to expose is the functionality provided by
>> qemu's audio-spice module, which IIUC is essentially `-audiodev spice`.
>> After peeking at the qmp ref manual [1] I expected to find an "audiodev"
>> object, however
>>
>> # virsh qemu-monitor-command test \
>>    --cmd '{"execute":"qom-list-types"}' | grep -i audiodev
>> #
>> # virsh qemu-monitor-command test --cmd \
>>    '{"execute":"qom-list-properties","arguments":{"typename":"audiodev"}}'
>> {"id":"libvirt-411","error":{"class":"DeviceNotFound","desc":"Class
>> 'audiodev' not found"}}
>> # virsh qemu-monitor-command test --cmd \
>>    '{"execute":"device-list-properties","arguments":{"typename":"audiodev"}}'
>> {"id":"libvirt-412","error":{"class":"DeviceNotFound","desc":"Device
>> 'audiodev' not found"}}
>>
>> Command line help is not available either, which spawned Claudio's qemu patch [2]
>>
>> # qemu-system-x86_64 -audiodev help
>> qemu-system-x86_64: -audiodev help: Help is not available for this option
> 
> In cases where a command line option parser in qemu was implemented via
> the modern QOM based approach, but at the same time is not runtime
> configurable or queryable via the monitor it's not possible for libvirt
> to detect the options.
> 
> Historically command line arguments could be queried via
> 'query-command-line-options' command but that was deemed to be
> un-extendible and new code is not getting coverage. At the same time
> libvirt is trying to decrease the reliance on the command to allow
> deprecation and promote some form of replacement.
> 
> We had a similar problem for graphics options, which was side-stepped by
> implementing 'query-display-options' which in turn exposed all the
> objects in the QMP schema (query-qmp-schema) which allowed us to detet
> graphics related functionality.
> 
> At this point we e.g. assume that the modern -audiodev is present. For
> few specific configs we validate that the appropriate graphics protocol
> is used for the VM but don't validate anything else.
> 
> For your specific query, the spice backend for audio is allowed only
> when spice video is enabled anyways, so the capability you are
> suggesting does not seem to be that much interesting as the decision can
> be based on the graphics protocol support.

IIUC, it is possible to have a qemu installation with spice video support but 
without the audio-spice module. If that is the case, seems we need to report the 
available audio backends in domcaps.

Regards,
Jim
Re: [PATCH 0/3] domain capabilites improvements
Posted by Peter Krempa 1 year, 7 months ago
On Thu, Sep 08, 2022 at 13:18:19 -0600, Jim Fehlig wrote:
> On 9/8/22 01:52, Peter Krempa wrote:
> > On Wed, Sep 07, 2022 at 15:20:44 -0600, Jim Fehlig wrote:
> > > On 9/6/22 14:42, Jim Fehlig wrote:

[...]

> > In cases where a command line option parser in qemu was implemented via
> > the modern QOM based approach, but at the same time is not runtime
> > configurable or queryable via the monitor it's not possible for libvirt
> > to detect the options.
> > 
> > Historically command line arguments could be queried via
> > 'query-command-line-options' command but that was deemed to be
> > un-extendible and new code is not getting coverage. At the same time
> > libvirt is trying to decrease the reliance on the command to allow
> > deprecation and promote some form of replacement.
> > 
> > We had a similar problem for graphics options, which was side-stepped by
> > implementing 'query-display-options' which in turn exposed all the
> > objects in the QMP schema (query-qmp-schema) which allowed us to detet
> > graphics related functionality.
> > 
> > At this point we e.g. assume that the modern -audiodev is present. For
> > few specific configs we validate that the appropriate graphics protocol
> > is used for the VM but don't validate anything else.
> > 
> > For your specific query, the spice backend for audio is allowed only
> > when spice video is enabled anyways, so the capability you are
> > suggesting does not seem to be that much interesting as the decision can
> > be based on the graphics protocol support.
> 
> IIUC, it is possible to have a qemu installation with spice video support
> but without the audio-spice module. If that is the case, seems we need to
> report the available audio backends in domcaps.

Well, I'd reckon that in most cases this will be "administratively"
solved by simply packaging spice audio together with the graphics
protocol.

Anyways, at this point it doesn't seem to be possible to introspect the
presence of that feature. Luckily the domain capabilities allow tristate
logic reasonably since once qemu adds the introspectability we'll
have to assume that versions which don't allow introspection may support
the audio-spice backend.

Regarding qemu adding introspectability I think it will not be that
straightforward though. Specifically retrofitting it into
query-command-line-options as well as adding a dummy query command
(similarly to 'query-display-options') may be frowned upon [1], and I'm
not sure how the things are with the qapified command option schema.

[1] https://lists.nongnu.org/archive/html/qemu-devel/2018-11/msg05162.html