From: Olaf Hering Subject: [PATCH 2/2] libxl: set DISPLAY and XAUTHORITY if sdl is enabled Date: Mon, 20 Apr 2015 13:40:32 +0000 Message-ID: <1429537232-8356-3-git-send-email-olaf@aepfle.de> References: <1429537232-8356-1-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429537232-8356-1-git-send-email-olaf@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Wei Liu , Olaf Hering , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 Cc: Ian Jackson Cc: Stefano Stabellini Cc: Ian Campbell Cc: Wei Liu --- docs/man/xl.cfg.pod.5 | 7 ++----- tools/libxl/libxl_dm.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 index d395e56..0bc1031 100644 --- a/docs/man/xl.cfg.pod.5 +++ b/docs/man/xl.cfg.pod.5 @@ -619,15 +619,12 @@ Simple DirectMedia Layer). The default is to not enable this mode. =item C 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 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 diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 3db12ba..18b27f8 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -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); @@ -560,7 +563,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) {