Bug 1648236 - QEMU doesn't expose rendernode option for egl-headless display type
Summary: QEMU doesn't expose rendernode option for egl-headless display type
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Guo, Zhiyi
URL:
Whiteboard:
Depends On:
Blocks: 1652871 1628892 1671594
TreeView+ depends on / blocked
 
Reported: 2018-11-09 08:17 UTC by Erik Skultety
Modified: 2019-08-22 09:21 UTC (History)
6 users (show)

Fixed In Version: qemu-kvm-rhev-2.12.0-25.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1652871 (view as bug list)
Environment:
Last Closed: 2019-08-22 09:19:58 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2553 None None None 2019-08-22 09:21:28 UTC

Description Erik Skultety 2018-11-09 08:17:49 UTC
Description of problem:
It's not possible to specify rendernode with egl-headless compared to spice which means that QEMU will always pick the first render node available, which will never work with libvirt namespaces, because libvirt doesn't know which DRM node to put into the namespace which will inherently result in a failure to start a VM.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.12.0-14.el7.x86_64

How reproducible:

Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:
QEMU accepts rendernode option for egl-headless display type so that libvirt can take care of the access rights.

Additional info:
See https://bugzilla.redhat.com/show_bug.cgi?id=1628892 for more detail and how to reproduce. Even though libvirt now lets QEMU to pick the rendernode for SPICE if the user didn't provide it, this will change due to namespaces and libvirt will pick the first available rendernode the same way QEMU has been doing it.

Comment 1 Erik Skultety 2018-11-19 13:02:01 UTC
Support was added upstream by commit:
commit 91e61947eb2be21b00091d34f5692f89cef41376
Author:     Erik Skultety <eskultet@redhat.com>
AuthorDate: Fri Nov 16 11:14:43 2018 +0100
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Fri Nov 16 11:44:22 2018 +0100

    ui: Allow specifying 'rendernode' display option for egl-headless
    
    As libvirt can't predict which rendernode QEMU would pick, it
    won't adjust the permissions on the device, hence QEMU getting
    "Permission denied" when opening the DRI device. Therefore, enable
    'rendernode' option for egl-headless display type.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1648236
    
    Signed-off-by: Erik Skultety <eskultet@redhat.com>
    Message-id: 27f4617f19aa1072114f10f1aa9dd199735ef982.1542362949.git.eskultet@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Comment 2 Gerd Hoffmann 2018-11-22 13:37:55 UTC
Also needed: https://patchwork.ozlabs.org/patch/1001567/

Comment 3 Ademar Reis 2018-12-21 21:57:20 UTC
(In reply to Gerd Hoffmann from comment #2)
> Also needed: https://patchwork.ozlabs.org/patch/1001567/

Merged upstream in 3.1, pending backport:

commit e1ca8f7e1915496148f6e0ce1f7c2309af013312
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Thu Nov 22 08:16:13 2018 +0100

    qapi: add query-display-options command
    
    Add query-display-options command, which allows querying the qemu
    display configuration.  This isn't particularly useful, except it
    exposes QAPI type DisplayOptions in query-qmp-schema, so that libvirt
    can discover recently added -display parameter rendernode (commit
    d4dc4ab133b).  Works around lack of sufficiently powerful command line
    introspection.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Tested-by: Erik Skultety <eskultet@redhat.com>
    Message-id: 20181122071613.2889-1-kraxel@redhat.com

Comment 10 Miroslav Rezanina 2019-03-20 04:57:19 UTC
Fix included in qemu-kvm-rhev-2.12.0-25.el7

Comment 12 Guo, Zhiyi 2019-04-24 06:41:43 UTC
Test against qemu-kvm-rhev-2.12.0-24.el7.x86_64 that without rendernode

Scenarios performed:

1) start qemu with /usr/libexec/qemu-kvm -display egl-headless
qemu can start

2) start qemu with /usr/libexec/qemu-kvm -display egl-headless,rendernode=/dev/dri/foo -qmp unix:/tmp/qmp,server,nowait -monitor stdio
qemu can start

3) check qmp commands supported from qemu, there is no command called query-display-options

Test against qemu-kvm-rhev-2.12.0-25.el7.x86_64 that has rendernode

1) can still pass

2) will report error as expected:
(qemu) qemu-kvm: egl: no drm render node available
qemu-kvm: egl: render node init failed

Switch to an existed render provider, qemu can start without error:
# /usr/libexec/qemu-kvm -display egl-headless,rendernode=/dev/dri/renderD128 -qmp unix:/tmp/qmp,server,nowait -monitor stdio
QEMU 2.12.0 monitor - type 'help' for more information
(qemu)

3)check qmp commands supported from qemu, command query-display-options prompt been supported:
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "query-commands" }
...
{"name": "query-display-options"}
...

4) Execute this qmp command:
{ "execute": "query-display-options"}
{"return": {"type": "egl-headless"}}

5) Execute query-display-options when -display none:
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "query-display-options"}
{"return": {"type": "none"}}

6) Execute query-display-options when -display option is not specified, vnc and spice has been tried:
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "query-display-options"}
{"return": {"type": "none"}}

7) boot rhel 7.7 guest with qemu cli
# /usr/libexec/qemu-kvm -display egl-headless -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/89d223b5-8e86-4682-b703-acf28f1fece8,display=on -monitor stdio -cpu Skylake-Client,enforce -m 8G -hda /home/rhel7.qcow2 -vnc :0 -serial unix:/tmp/console,server,nowait guest can boot to desktop and use gvt as desktop provider without problem

Comment 13 Guo, Zhiyi 2019-04-24 06:42:21 UTC
Verified per comment 12

Comment 15 errata-xmlrpc 2019-08-22 09:19:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2553


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