Bug 1790902 - virsh domcapabilities incorrectly includes sdl
Summary: virsh domcapabilities incorrectly includes sdl
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.4
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: 8.5
Assignee: Peter Krempa
QA Contact: smitterl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-14 13:59 UTC by smitterl
Modified: 2021-08-06 15:59 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-30 08:43:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description smitterl 2020-01-14 13:59:57 UTC
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>
...

Comment 1 Thomas Huth 2020-01-21 06:23:53 UTC
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".

Comment 3 Michal Privoznik 2021-02-15 14:13:39 UTC
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?

Comment 4 Thomas Huth 2021-02-15 14:43:03 UTC
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.

Comment 5 Peter Krempa 2021-02-15 14:54:18 UTC
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).

Comment 6 Gerd Hoffmann 2021-02-15 15:26:39 UTC
(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 ...

Comment 7 Thomas Huth 2021-06-09 10:07:46 UTC
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...

Comment 9 Peter Krempa 2021-06-16 11:07:56 UTC
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.

Comment 14 Thomas Huth 2021-06-30 08:43:38 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.