All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type
@ 2018-11-15 15:15 Erik Skultety
  2018-11-15 15:15 ` [Qemu-devel] [PATCH 1/3] qapi: Add "rendernode" display option for egl-headless Erik Skultety
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Erik Skultety @ 2018-11-15 15:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Erik Skultety, kraxel

Since QEMU always picks the default DRI device, libvirt doesn't know which one
to put into the mount namespace and relabel it accordingly, hence hitting
permission issues, unless admin tweaks the default permissions of the DRI
devices.

https://bugzilla.redhat.com/show_bug.cgi?id=1648236

Erik Skultety (3):
  qapi: Add "rendernode" display option for egl-headless
  ui: Allow specifying 'rendernode' display option for egl-headless
  help: Provide help for egl-headless

 qapi/ui.json      | 16 +++++++++++++++-
 qemu-options.hx   |  6 +++++-
 ui/egl-headless.c |  2 +-
 3 files changed, 21 insertions(+), 3 deletions(-)

--
2.19.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 1/3] qapi: Add "rendernode" display option for egl-headless
  2018-11-15 15:15 [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Erik Skultety
@ 2018-11-15 15:15 ` Erik Skultety
  2018-11-15 15:48   ` Eric Blake
  2018-11-15 15:15 ` [Qemu-devel] [PATCH 2/3] ui: Allow specifying 'rendernode' " Erik Skultety
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Erik Skultety @ 2018-11-15 15:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Erik Skultety, Gerd Hoffmann, Eric Blake, Markus Armbruster

Unlike SPICE, egl-headless doesn't offer a way of specifying the DRM
node used for OpenGL, hence QEMU always selecting the first one that is
available. Thus, add rendernode option to QAPI.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
---
 qapi/ui.json | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/qapi/ui.json b/qapi/ui.json
index bf9e157d5a..7ecc6eb67e 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1037,6 +1037,19 @@
   'data'    : { '*grab-on-hover' : 'bool',
                 '*zoom-to-fit'   : 'bool'  } }
 
+##
+# @DisplayEGLHeadless:
+#
+# EGL headless display options.
+#
+# @rendernode: Which DRM render node should be used.
+#
+# Since: 3.2
+#
+##
+{ 'struct'  : 'DisplayEGLHeadless',
+  'data'    : { '*rendernode' : 'str' } }
+
  ##
  # @DisplayGLMode:
  #
@@ -1086,4 +1099,5 @@
                 '*window-close'  : 'bool',
                 '*gl'            : 'DisplayGLMode' },
   'discriminator' : 'type',
-  'data'    : { 'gtk'            : 'DisplayGTK' } }
+  'data'    : { 'gtk'            : 'DisplayGTK',
+                'egl-headless'   : 'DisplayEGLHeadless'} }
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 2/3] ui: Allow specifying 'rendernode' display option for egl-headless
  2018-11-15 15:15 [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Erik Skultety
  2018-11-15 15:15 ` [Qemu-devel] [PATCH 1/3] qapi: Add "rendernode" display option for egl-headless Erik Skultety
@ 2018-11-15 15:15 ` Erik Skultety
  2018-11-15 15:15 ` [Qemu-devel] [PATCH 3/3] help: Provide help " Erik Skultety
  2018-11-15 15:47 ` [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Eric Blake
  3 siblings, 0 replies; 9+ messages in thread
From: Erik Skultety @ 2018-11-15 15:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Erik Skultety, Gerd Hoffmann

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>
---
 ui/egl-headless.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index 42a41310b0..4cf3bbc0e4 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -176,7 +176,7 @@ static void egl_headless_init(DisplayState *ds, DisplayOptions *opts)
     egl_dpy *edpy;
     int idx;
 
-    if (egl_rendernode_init(NULL, mode) < 0) {
+    if (egl_rendernode_init(opts->u.egl_headless.rendernode, mode) < 0) {
         error_report("egl: render node init failed");
         exit(1);
     }
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 3/3] help: Provide help for egl-headless
  2018-11-15 15:15 [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Erik Skultety
  2018-11-15 15:15 ` [Qemu-devel] [PATCH 1/3] qapi: Add "rendernode" display option for egl-headless Erik Skultety
  2018-11-15 15:15 ` [Qemu-devel] [PATCH 2/3] ui: Allow specifying 'rendernode' " Erik Skultety
@ 2018-11-15 15:15 ` Erik Skultety
  2018-11-15 15:47 ` [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Eric Blake
  3 siblings, 0 replies; 9+ messages in thread
From: Erik Skultety @ 2018-11-15 15:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Erik Skultety

EGL headless has been missing from QEMU's help or man page, we should
mention that such a thing exists, especially since projects like libvirt
might rely on that. This patch also adds the newly introduced option for
egl-headless 'rendernode'.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
---
 qemu-options.hx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index ee379b32e3..f7df472f43 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1216,7 +1216,8 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
     "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
     "-display vnc=<display>[,<optargs>]\n"
     "-display curses\n"
-    "-display none"
+    "-display none\n"
+    "-display egl-headless[,rendernode=<file>]"
     "                select display type\n"
     "The default display is equivalent to\n"
 #if defined(CONFIG_GTK)
@@ -1258,6 +1259,9 @@ menus and other UI elements to configure and control the VM during
 runtime.
 @item vnc
 Start a VNC server on display <arg>
+@item egl-headless
+Offload all OpenGL operations to a local DRI device. For any graphical display,
+this display needs to be paired with either VNC or SPICE displays.
 @end table
 ETEXI
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type
  2018-11-15 15:15 [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Erik Skultety
                   ` (2 preceding siblings ...)
  2018-11-15 15:15 ` [Qemu-devel] [PATCH 3/3] help: Provide help " Erik Skultety
@ 2018-11-15 15:47 ` Eric Blake
  2018-11-16  8:43   ` Gerd Hoffmann
  3 siblings, 1 reply; 9+ messages in thread
From: Eric Blake @ 2018-11-15 15:47 UTC (permalink / raw)
  To: Erik Skultety, qemu-devel; +Cc: kraxel

On 11/15/18 9:15 AM, Erik Skultety wrote:
> Since QEMU always picks the default DRI device, libvirt doesn't know which one
> to put into the mount namespace and relabel it accordingly, hence hitting
> permission issues, unless admin tweaks the default permissions of the DRI
> devices.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1648236

This is borderline between fixing a bug that gets in the way of libvirt 
(and thus useful for 3.1) and a feature (thus for 4.0, since we won't 
have a 3.2 release). I'll let Gerd decide.

> 
> Erik Skultety (3):
>    qapi: Add "rendernode" display option for egl-headless
>    ui: Allow specifying 'rendernode' display option for egl-headless
>    help: Provide help for egl-headless
> 
>   qapi/ui.json      | 16 +++++++++++++++-
>   qemu-options.hx   |  6 +++++-
>   ui/egl-headless.c |  2 +-
>   3 files changed, 21 insertions(+), 3 deletions(-)
> 
> --
> 2.19.1
> 
> 
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 1/3] qapi: Add "rendernode" display option for egl-headless
  2018-11-15 15:15 ` [Qemu-devel] [PATCH 1/3] qapi: Add "rendernode" display option for egl-headless Erik Skultety
@ 2018-11-15 15:48   ` Eric Blake
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Blake @ 2018-11-15 15:48 UTC (permalink / raw)
  To: Erik Skultety, qemu-devel; +Cc: Gerd Hoffmann, Markus Armbruster

On 11/15/18 9:15 AM, Erik Skultety wrote:
> Unlike SPICE, egl-headless doesn't offer a way of specifying the DRM
> node used for OpenGL, hence QEMU always selecting the first one that is
> available. Thus, add rendernode option to QAPI.
> 
> Signed-off-by: Erik Skultety <eskultet@redhat.com>
> ---
>   qapi/ui.json | 16 +++++++++++++++-
>   1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi/ui.json b/qapi/ui.json
> index bf9e157d5a..7ecc6eb67e 100644
> --- a/qapi/ui.json
> +++ b/qapi/ui.json
> @@ -1037,6 +1037,19 @@
>     'data'    : { '*grab-on-hover' : 'bool',
>                   '*zoom-to-fit'   : 'bool'  } }
>   
> +##
> +# @DisplayEGLHeadless:
> +#
> +# EGL headless display options.
> +#
> +# @rendernode: Which DRM render node should be used.
> +#
> +# Since: 3.2

Either 3.1 or 4.0, depending on whether this is okay this late after 
soft freeze.  Worth mentioning that rendernode defaults to the first 
available node?

> +#
> +##
> +{ 'struct'  : 'DisplayEGLHeadless',
> +  'data'    : { '*rendernode' : 'str' } }
> +
>    ##
>    # @DisplayGLMode:
>    #
> @@ -1086,4 +1099,5 @@
>                   '*window-close'  : 'bool',
>                   '*gl'            : 'DisplayGLMode' },
>     'discriminator' : 'type',
> -  'data'    : { 'gtk'            : 'DisplayGTK' } }
> +  'data'    : { 'gtk'            : 'DisplayGTK',
> +                'egl-headless'   : 'DisplayEGLHeadless'} }
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type
  2018-11-15 15:47 ` [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Eric Blake
@ 2018-11-16  8:43   ` Gerd Hoffmann
  2018-11-16  9:24     ` Erik Skultety
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Hoffmann @ 2018-11-16  8:43 UTC (permalink / raw)
  To: Eric Blake; +Cc: Erik Skultety, qemu-devel

On Thu, Nov 15, 2018 at 09:47:44AM -0600, Eric Blake wrote:
> On 11/15/18 9:15 AM, Erik Skultety wrote:
> > Since QEMU always picks the default DRI device, libvirt doesn't know which one
> > to put into the mount namespace and relabel it accordingly, hence hitting
> > permission issues, unless admin tweaks the default permissions of the DRI
> > devices.
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=1648236
> 
> This is borderline between fixing a bug that gets in the way of libvirt (and
> thus useful for 3.1) and a feature (thus for 4.0, since we won't have a 3.2
> release). I'll let Gerd decide.

It's simple enough and we are early in the -rc cycle still, I think it
would be okay for 3.1.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type
  2018-11-16  8:43   ` Gerd Hoffmann
@ 2018-11-16  9:24     ` Erik Skultety
  2018-11-16  9:30       ` Gerd Hoffmann
  0 siblings, 1 reply; 9+ messages in thread
From: Erik Skultety @ 2018-11-16  9:24 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Eric Blake, qemu-devel

On Fri, Nov 16, 2018 at 09:43:52AM +0100, Gerd Hoffmann wrote:
> On Thu, Nov 15, 2018 at 09:47:44AM -0600, Eric Blake wrote:
> > On 11/15/18 9:15 AM, Erik Skultety wrote:
> > > Since QEMU always picks the default DRI device, libvirt doesn't know which one
> > > to put into the mount namespace and relabel it accordingly, hence hitting
> > > permission issues, unless admin tweaks the default permissions of the DRI
> > > devices.
> > >
> > > https://bugzilla.redhat.com/show_bug.cgi?id=1648236
> >
> > This is borderline between fixing a bug that gets in the way of libvirt (and
> > thus useful for 3.1) and a feature (thus for 4.0, since we won't have a 3.2
> > release). I'll let Gerd decide.
>
> It's simple enough and we are early in the -rc cycle still, I think it
> would be okay for 3.1.

As far as upstream's concerned, I'm okay with both because libvirt has to add
another version specific capability enum for this anyway. It's been broken
since libvirt 4.6.0 where I added egl-headless graphics type. Luckily, even
though it's far from optimal, a working solution exists, just change the
permissions on the device.

Thanks,
Erik

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type
  2018-11-16  9:24     ` Erik Skultety
@ 2018-11-16  9:30       ` Gerd Hoffmann
  0 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2018-11-16  9:30 UTC (permalink / raw)
  To: Erik Skultety; +Cc: Eric Blake, qemu-devel

On Fri, Nov 16, 2018 at 10:24:30AM +0100, Erik Skultety wrote:
> On Fri, Nov 16, 2018 at 09:43:52AM +0100, Gerd Hoffmann wrote:
> > It's simple enough and we are early in the -rc cycle still, I think it
> > would be okay for 3.1.
> 
> As far as upstream's concerned, I'm okay with both because libvirt has to add
> another version specific capability enum for this anyway. It's been broken
> since libvirt 4.6.0 where I added egl-headless graphics type. Luckily, even
> though it's far from optimal, a working solution exists, just change the
> permissions on the device.

I'm fine either way too.  So just pick a version, update the doc
comments and repost.

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-16  9:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15 15:15 [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Erik Skultety
2018-11-15 15:15 ` [Qemu-devel] [PATCH 1/3] qapi: Add "rendernode" display option for egl-headless Erik Skultety
2018-11-15 15:48   ` Eric Blake
2018-11-15 15:15 ` [Qemu-devel] [PATCH 2/3] ui: Allow specifying 'rendernode' " Erik Skultety
2018-11-15 15:15 ` [Qemu-devel] [PATCH 3/3] help: Provide help " Erik Skultety
2018-11-15 15:47 ` [Qemu-devel] [PATCH 0/3] Introduce 'rendernode' option for egl-headless display type Eric Blake
2018-11-16  8:43   ` Gerd Hoffmann
2018-11-16  9:24     ` Erik Skultety
2018-11-16  9:30       ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.