ia64/xen-unstable

changeset 8453:0e47bcdac69d

Set up X11 authorization when a VMX domain uses SDL.

Signed-off-by: Hiromichi Itou <ito@begi.net>
author kaf24@firebug.cl.cam.ac.uk
date Wed Dec 28 15:14:23 2005 +0100 (2005-12-28)
parents 27ea8232fe79
children f36627941bbe
files tools/python/xen/xend/image.py tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Wed Dec 28 15:07:43 2005 +0100
     1.2 +++ b/tools/python/xen/xend/image.py	Wed Dec 28 15:14:23 2005 +0100
     1.3 @@ -194,6 +194,7 @@ class VmxImageHandler(ImageHandler):
     1.4          if not self.device_model:
     1.5              raise VmError("vmx: missing device model")
     1.6          self.display = sxp.child_value(imageConfig, 'display')
     1.7 +        self.xauthority = sxp.child_value(imageConfig, 'xauthority')
     1.8  
     1.9          self.vm.storeVm(("image/dmargs", " ".join(self.dmargs)),
    1.10                          ("image/device-model", self.device_model),
    1.11 @@ -340,6 +341,8 @@ class VmxImageHandler(ImageHandler):
    1.12          env = dict(os.environ)
    1.13          if self.display:
    1.14              env['DISPLAY'] = self.display
    1.15 +        if self.xauthority:
    1.16 +            env['XAUTHORITY'] = self.xauthority
    1.17          log.info("spawning device models: %s %s", self.device_model, args)
    1.18          self.pid = os.spawnve(os.P_NOWAIT, self.device_model, args, env)
    1.19          log.info("device model pid: %d", self.pid)
     2.1 --- a/tools/python/xen/xm/create.py	Wed Dec 28 15:07:43 2005 +0100
     2.2 +++ b/tools/python/xen/xm/create.py	Wed Dec 28 15:14:23 2005 +0100
     2.3 @@ -388,6 +388,10 @@ gopts.var('display', val='DISPLAY',
     2.4            fn=set_value, default=None,
     2.5            use="X11 display to use")
     2.6  
     2.7 +gopts.var('xauthority', val='XAUTHORITY',
     2.8 +          fn=set_value, default=None,
     2.9 +          use="X11 Authority to use")
    2.10 +
    2.11  
    2.12  def err(msg):
    2.13      """Print an error to stderr and exit.
    2.14 @@ -526,7 +530,8 @@ def configure_vmx(config_image, vals):
    2.15      """
    2.16      args = [ 'device_model', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
    2.17               'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'audio',
    2.18 -             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic']
    2.19 +             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic',
    2.20 +             'xauthority' ]
    2.21      for a in args:
    2.22          if (vals.__dict__[a]):
    2.23              config_image.append([a, vals.__dict__[a]])
    2.24 @@ -801,6 +806,9 @@ def parseCommandLine(argv):
    2.25      if not gopts.vals.display:
    2.26          gopts.vals.display = os.getenv("DISPLAY")
    2.27  
    2.28 +    if not gopts.vals.xauthority:
    2.29 +        gopts.vals.xauthority = os.getenv("XAUTHORITY")
    2.30 +
    2.31      # Process remaining args as config variables.
    2.32      for arg in args:
    2.33          if '=' in arg: