libxl: set DISPLAY and XAUTHORITY if sdl is enabled
authorOlaf Hering <olaf@aepfle.de>
Mon, 20 Apr 2015 13:40:32 +0000 (13:40 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 21 May 2015 14:12:10 +0000 (15:12 +0100)
With this change the following domU.cfg will show the VM window on the
local dom0 display, instead of the remote side (it via ssh -X login):
  vnc=0
  sdl=1
  display=":0"
  xauthority="/run/gdm/auth-for-olaf-nMXhOi/database"

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
docs/man/xl.cfg.pod.5
tools/libxl/libxl_dm.c

index a189091f7bf1d081fc6ca853e780134f53b960b6..0bbd3c3b30302a2e7ade511cdf41a2bb69d7416c 100644 (file)
@@ -577,15 +577,12 @@ Simple DirectMedia Layer). The default is to not enable this mode.
 =item C<display=DISPLAY>
 
 Specifies the X Window display that should be used when the sdl option
-is used. Note: passing this value to the device-model is not currently
-implemented, so providing this option will have no effect.
+is used.
 
 =item C<xauthority=XAUTHORITY>
 
 Specifies the path to the X authority file that should be used to
-connect to the X server when the sdl option is used. Note: passing
-this value to the device-model is not currently implemented, so
-providing this option will have no effect.
+connect to the X server when the sdl option is used.
 
 =item C<opengl=BOOLEAN>
 
index 95660b849d8a7fc9cad6de467ca52f5e5fca0766..3dd7c0454c4ac3a53b438b934ff04b36f8c5cd3f 100644 (file)
@@ -196,7 +196,10 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
         if (!libxl_defbool_val(sdl->opengl)) {
             flexarray_append(dm_args, "-disable-opengl");
         }
-        /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
+        if (sdl->display)
+            flexarray_append_pair(dm_envs, "DISPLAY", sdl->display);
+        if (sdl->xauthority)
+            flexarray_append_pair(dm_envs, "XAUTHORITY", sdl->xauthority);
     }
     if (keymap) {
         flexarray_vappend(dm_args, "-k", keymap, NULL);
@@ -562,7 +565,10 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
     if (sdl) {
         flexarray_append(dm_args, "-sdl");
-        /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
+        if (sdl->display)
+            flexarray_append_pair(dm_envs, "DISPLAY", sdl->display);
+        if (sdl->xauthority)
+            flexarray_append_pair(dm_envs, "XAUTHORITY", sdl->xauthority);
     }
 
     if (keymap) {