All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Smith <sos22-xen@srcf.ucam.org>
To: Jeremy Katz <katzj@redhat.com>
Cc: xen-devel <xen-devel@lists.xensource.com>,
	Markus Armbruster <armbru@redhat.com>,
	sos22@srcf.ucam.org
Subject: Re: [PATCH] Paravirt framebuffer support in xend [3/5]
Date: Mon, 4 Sep 2006 10:02:09 +0100	[thread overview]
Message-ID: <20060904090209.GD4812@cam.ac.uk> (raw)
In-Reply-To: <1157227117.11059.43.camel@aglarond.local>


[-- Attachment #1.1: Type: text/plain, Size: 6055 bytes --]


> Add support in xend and xm to know about the vnc and sdl options for PV
> domains.  Launch xen-sdlfb or xen-vncfb if we're setting up a graphics
> console.  Also, if we're going to use a graphical console in the guest,
> set /<dompath>/console/use_graphics to 1.
> 
> (Note: this patch requires a tiny bit of obvious change to work with my
> patch for vnclisten that I posted earlier today)
> 
> Signed-off-by: Jeremy Katz <katzj@redhat.com>

> diff -r a2a8f1ed16ea -r 2b360c6b44fa tools/python/xen/xend/image.py
> --- a/tools/python/xen/xend/image.py	Sat Sep 02 15:22:19 2006 -0400
> +++ b/tools/python/xen/xend/image.py	Sat Sep 02 15:23:32 2006 -0400
> @@ -20,8 +20,10 @@ import os, string
>  import os, string
>  import re
>  import math
> +import signal
Why?

>  
>  import xen.lowlevel.xc
> +import xen.util.auxbin
>  from xen.xend import sxp
>  from xen.xend.XendError import VmError
>  from xen.xend.XendLogging import log
> @@ -189,6 +191,68 @@ class LinuxImageHandler(ImageHandler):
>                                cmdline        = self.cmdline,
>                                ramdisk        = self.ramdisk,
>                                features       = self.vm.getFeatures())
> +
> +    def configure(self, imageConfig, deviceConfig):
Does this really belong in class LinuxImageHandler?

> +        ImageHandler.configure(self, imageConfig, deviceConfig)
> +
> +        self.pid = 0
> +        log.info("configuring linux guest")
> +
> +        # set up the graphics bits.
> +        # FIXME: this is much like what we do for HVM, should it be 
> +        # for all image types now?
> +        self.display = sxp.child_value(imageConfig, 'display')
> +        self.xauthority = sxp.child_value(imageConfig, 'xauthority')
> +        self.vncconsole = sxp.child_value(imageConfig, 'vncconsole')
> +        self.vnc = sxp.child_value(imageConfig, 'vnc')
> +        self.sdl = sxp.child_value(imageConfig, 'sdl')
> +        if self.vnc:
> +            self.vncdisplay = sxp.child_value(imageConfig, 'vncdisplay',
> +                                              int(self.vm.getDomid()))
> +            self.vncunused = sxp.child_value(imageConfig, 'vncunused')
> +            self.vnclisten = sxp.child_value(imageConfig, 'vnclisten')
> +        if self.vnc or self.sdl:
> +            log.info("setting use_graphics")
> +            self.vm.writeDom("console/use_graphics", "1")
> +        else:
> +            self.vm.writeDom("console/use_graphics", "0")
> +
> +    def createDeviceModel(self):
Maybe call ImageHandler.createDeviceModel?

> +        if self.pid:
> +            return
> +        # Execute device model (for us, it's just the fb frontend)
> +        if not self.vnc and not self.sdl:
> +            return
> +
> +        if self.vnc:
> +            args = [xen.util.auxbin.pathTo("xen-vncfb")]
> +            if self.vncunused:
> +                args += ['--unused']
> +            elif self.vncdisplay:
> +                args += [ "--vncport", "%d" %(5900 + self.vncdisplay,) ]
> +            if self.vnclisten:
> +                args += [ "--listen", self.vnclisten ]
> +            if self.vncconsole:
> +                args += [ "--vncviewer" ]
> +        elif self.sdl:
> +            args = [xen.util.auxbin.pathTo("xen-sdlfb")]
> +        args = args + [ "--domid", "%d" % self.vm.getDomid(),
> +                        "--title", self.vm.info['name'] ]
> +        env = dict(os.environ)
> +        if self.display:
> +            env['DISPLAY'] = self.display
> +        if self.xauthority:
> +            env['XAUTHORITY'] = self.xauthority
> +        log.info("spawning video: %s", args)
> +        self.pid = os.spawnve(os.P_NOWAIT, args[0], args, env)
> +        log.info("device model pid: %d", self.pid)
> +
> +    def destroy(self):
> +        if not self.pid:
> +            return
> +        os.kill(self.pid, signal.SIGKILL)
> +        os.waitpid(self.pid, 0)
> +        self.pid = 0
>  
>  class PPC_LinuxImageHandler(LinuxImageHandler):
>  
> @@ -371,7 +435,6 @@ class HVMImageHandler(ImageHandler):
>  
>      def destroy(self):
>          self.unregister_shutdown_watch();
> -        import signal
Why?

>          if not self.pid:
>              return
>          os.kill(self.pid, signal.SIGKILL)
> diff -r a2a8f1ed16ea -r 2b360c6b44fa tools/python/xen/xm/create.py
> --- a/tools/python/xen/xm/create.py	Sat Sep 02 15:22:19 2006 -0400
> +++ b/tools/python/xen/xm/create.py	Sat Sep 02 15:23:32 2006 -0400
> @@ -483,6 +483,8 @@ def configure_image(vals):
>  
>      if vals.builder == 'hvm':
>          configure_hvm(config_image, vals)
> +
> +    configure_graphics(config_image, vals)        
>          
>      return config_image
>      
> @@ -630,14 +632,21 @@ def configure_vifs(config_devs, vals):
>          map(f, d.keys())
>          config_devs.append(['device', config_vif])
>  
> +def configure_graphics(config_image, vals):
> +    """Create the config for graphic consoles.
> +    """
> +    args = [ 'vnc', 'vncdisplay', 'vncconsole', 'vncunused',
> +             'sdl', 'display', 'xauthority' ]
> +    for a in args:
> +        if (vals.__dict__[a]):
> +            config_image.append([a, vals.__dict__[a]])
This looks very wrong.  What is it trying to do?  Why do these parameters
need to be handled differently from the ones in configure_image?

>  
>  def configure_hvm(config_image, vals):
>      """Create the config for HVM devices.
>      """
>      args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb',
>               'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw',
> -             'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'sdl', 'display',
> -             'acpi', 'apic', 'xauthority', 'usb', 'usbdevice' ]
> +             'acpi', 'apic', 'usb', 'usbdevice' ]
>      for a in args:
>          if (vals.__dict__[a]):
>              config_image.append([a, vals.__dict__[a]])

Steven.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2006-09-04  9:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-02 19:58 [PATCH] Paravirt framebuffer support in xend [3/5] Jeremy Katz
2006-09-04  9:02 ` Steven Smith [this message]
2006-09-05 16:11   ` Jeremy Katz
2006-09-06  9:17     ` Steven Smith
2006-09-06 11:43       ` sos22-xen
2006-09-06 13:59       ` Jeremy Katz
2006-09-07  8:01         ` Steven Smith
2006-09-14 19:27 ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060904090209.GD4812@cam.ac.uk \
    --to=sos22-xen@srcf.ucam.org \
    --cc=armbru@redhat.com \
    --cc=katzj@redhat.com \
    --cc=sos22@srcf.ucam.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.