Description of problem: sdl is not supported downstream on platform but virsh domcapabilities lists it. Version-Release number of selected component (if applicable): libvirt-4.5.0-37.module+el8.2.0+5221+0a85e35d.s390x qemu-kvm-2.12.0-96.module+el8.2.0+5387+0c6765ef.s390x How reproducible: Always Steps to Reproduce: 1. 'virsh domcapabilities --virttype kvm --machine s390-ccw-virtio --arch s390x --emulatorbin /usr/libexec/qemu-kvm' Actual results: ... <graphics supported='yes'> <enum name='type'> <value>sdl</value> <value>vnc</value> </enum> </graphics> ... Expected results: ... <graphics supported='yes'> <enum name='type'> <value>vnc</value> </enum> </graphics> ...
This can also be reproduced on x86 (we also do not support SDL in downstream here), so I'm changing the "Hardware" field to "All".
Unfortunately, there is no way to query whether qemu supports SDL, is there? For other display types Libvirt uses hacks like: see if query-vnc/query/spice/.. qmp command is available. Should we clone this to QEMU to track QEMU's work needed?
I think this capability is a remainder from the times when libvirt was still parsing the output of "qemu --help" to see which features are available. So it once used the "-sdl" parameter of QEMU to decide. But now that libvirt does not parse the parameters anymore, that's of course currently broken. Could libvirt maybe parse the output of "qemu -display help" instead? ... if that's not wanted, I think we likely need a new QMP command instead.
We currently probe qemu exclusively through QMP. Parsing of 'qemu -display help' would require another invocation of the qemu process which is out of question (even for possibly more useful queries than whether SDL is supported).
(In reply to Thomas Huth from comment #4) > I think this capability is a remainder from the times when libvirt was still > parsing the output of "qemu --help" to see which features are available. So > it once used the "-sdl" parameter of QEMU to decide. But now that libvirt > does not parse the parameters anymore, that's of course currently broken. > Could libvirt maybe parse the output of "qemu -display help" instead? ... if > that's not wanted, I think we likely need a new QMP command instead. Alternatively just drop sdl support. IIRC it always was a bit tricky to use because you had to pass the X11 display credentials somehow, and I suspect with wayland it is not working at all. I wouldn't be surprised if this isn't used in the real-world ...
I've now suggested something for QEMU here: https://lore.kernel.org/qemu-devel/20210609100240.1285032-1-thuth@redhat.com/ If that gets accepted, we might be able to detect the presence of SDL in QEMU from libvirt ... let's see how it goes...
The libvirt part was already pushed upstream: commit 599b17d5801cd717f1e6a990dbbe295ae2100433 Author: Peter Krempa <pkrempa> Date: Tue Jun 15 11:47:01 2021 +0200 qemu: capabilities: Fill SDL graphics support only when it's really supported virQEMUCapsFillDomainDeviceGraphicsCaps fills data needed both for validation of the graphics type and also for correct display in the (dom)capablities XML. Signal the support for SDL only when qemu has the capability. Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Ján Tomko <jtomko> Reviewed-by: Thomas Huth <thuth> commit 0a8d3740d03c05328348582c7825e41e210189ee Author: Peter Krempa <pkrempa> Date: Tue Jun 15 11:46:54 2021 +0200 tests: qemuxml2*: Add QEMU_CAPS_SDL to fake-caps tests using SDL graphics Next commit will modify the code so that it validates whether SDL is present. Certain tests need to get the SDL capability to keep working properly. Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Ján Tomko <jtomko> Reviewed-by: Thomas Huth <thuth> commit f9dda2805f0188f521bcc2d703a67b00a1609cec Author: Peter Krempa <pkrempa> Date: Tue Jun 15 11:38:26 2021 +0200 qemu: capabilities: Un-retire QEMU_CAPS_SDL SDL graphics can be compiled out in qemu so we need to be able to know whether the given qemu version support it. Base the capability on the presence of the 'sdl' member in 'query-display-options' or imply it if 'query-display-options' is not supported as we implied it before for all versions. Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Ján Tomko <jtomko> Reviewed-by: Thomas Huth <thuth> commit 55ead2333fd6e7d9ed6a151a3758137fbd044dca Author: Peter Krempa <pkrempa> Date: Tue Jun 15 11:31:35 2021 +0200 qemu: capabilities: Introduce QEMU_CAPS_QUERY_DISPLAY_OPTIONS The command allows to query various display-related options. The absence of the command will be used to imply certain video-related capabilities before we would be able to detect them. Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Ján Tomko <jtomko> Reviewed-by: Thomas Huth <thuth> v7.4.0-165-g599b17d580 Please note that the qemu patch mentioned in comment 7 is required so that qemu actually stops advertising SDL when not compiled in.
The QEMU patch has been merged here: https://git.qemu.org/?p=qemu.git;a=commitdiff;h=66c2207fd28a6025792fbb75151ee848b911dc35 We'll get this via rebase in the next version.