[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: allow VM configuration with both sdl=1 and vnc=1



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1236366803 0
# Node ID 0942baa2a088d47f6d4fdf531163172352b1013e
# Parent  ec3d0937095d25b86a2ad9d48ce441def57f9d70
xend: allow VM configuration with both sdl=1 and vnc=1

In the stubdom case you can now specify sdl=1 and vnc=1 (again, both
can be selected at the same time) in the vfb configuration.
So instead of:

vfb = [ 'type=vnc' ]

now you have:

vfb = [ 'vnc=1,sdl=1' ]

the former configuration option is deprecated but still supported for
backward compatibility.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/examples/xmexample.hvm-dm     |    2 +-
 tools/examples/xmexample.pv-grub    |   12 ++++++------
 tools/examples/xmexample1           |   12 ++++++------
 tools/examples/xmexample2           |   12 ++++++------
 tools/examples/xmexample3           |   12 ++++++------
 tools/python/xen/xend/XendConfig.py |    7 ++++---
 tools/python/xen/xend/image.py      |   20 ++++++++++++--------
 tools/python/xen/xm/create.py       |   16 +++++++++-------
 8 files changed, 50 insertions(+), 43 deletions(-)

diff -r ec3d0937095d -r 0942baa2a088 tools/examples/xmexample.hvm-dm
--- a/tools/examples/xmexample.hvm-dm   Fri Mar 06 19:10:29 2009 +0000
+++ b/tools/examples/xmexample.hvm-dm   Fri Mar 06 19:13:23 2009 +0000
@@ -11,4 +11,4 @@ disk = [ 'file:/var/images/min-el3-i386.
 disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ]
 
 # Actual output via PVFB
-vfb = [ 'type=sdl' ]
+vfb = [ 'sdl=1' ]
diff -r ec3d0937095d -r 0942baa2a088 tools/examples/xmexample.pv-grub
--- a/tools/examples/xmexample.pv-grub  Fri Mar 06 19:10:29 2009 +0000
+++ b/tools/examples/xmexample.pv-grub  Fri Mar 06 19:13:23 2009 +0000
@@ -77,29 +77,29 @@ disk = [ 'phy:hda1,hda1,w' ]
 #
 # To create one using the SDL backend and sensible defaults:
 #
-# vfb = [ 'type=sdl' ]
+# vfb = [ 'sdl=1' ]
 #
 # This uses environment variables XAUTHORITY and DISPLAY.  You
 # can override that:
 #
-# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+# vfb = [ 'sdl=1,xauthority=/home/bozo/.Xauthority,display=:1' ]
 #
 # To create one using the VNC backend and sensible defaults:
 #
-# vfb = [ 'type=vnc' ]
+# vfb = [ 'vnc=1' ]
 #
 # The backend listens on 127.0.0.1 port 5900+N by default, where N is
 # the domain ID.  You can override both address and N:
 #
-# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=1' ]
+# vfb = [ 'vnc=1,vnclisten=127.0.0.1,vncdisplay=1' ]
 #
 # Or you can bind the first unused port above 5900:
 #
-# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]
+# vfb = [ 'vnc=1,vnclisten=0.0.0.0,vncunused=1' ]
 #
 # You can override the password:
 #
-# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+# vfb = [ 'vnc=1,vncpasswd=MYPASSWD' ]
 #
 # Empty password disables authentication.  Defaults to the vncpasswd
 # configured in xend-config.sxp.
diff -r ec3d0937095d -r 0942baa2a088 tools/examples/xmexample1
--- a/tools/examples/xmexample1 Fri Mar 06 19:10:29 2009 +0000
+++ b/tools/examples/xmexample1 Fri Mar 06 19:13:23 2009 +0000
@@ -73,29 +73,29 @@ disk = [ 'phy:hda1,hda1,w' ]
 #
 # To create one using the SDL backend and sensible defaults:
 #
-# vfb = [ 'type=sdl' ]
+# vfb = [ 'sdl=1' ]
 #
 # This uses environment variables XAUTHORITY and DISPLAY.  You
 # can override that:
 #
-# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+# vfb = [ 'sdl=1,xauthority=/home/bozo/.Xauthority,display=:1' ]
 #
 # To create one using the VNC backend and sensible defaults:
 #
-# vfb = [ 'type=vnc' ]
+# vfb = [ 'vnc=1' ]
 #
 # The backend listens on 127.0.0.1 port 5900+N by default, where N is
 # the domain ID.  You can override both address and N:
 #
-# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=1' ]
+# vfb = [ 'vnc=1,vnclisten=127.0.0.1,vncdisplay=1' ]
 #
 # Or you can bind the first unused port above 5900:
 #
-# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]
+# vfb = [ 'vnc=1,vnclisten=0.0.0.0,vncunused=1' ]
 #
 # You can override the password:
 #
-# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+# vfb = [ 'vnc=1,vncpasswd=MYPASSWD' ]
 #
 # Empty password disables authentication.  Defaults to the vncpasswd
 # configured in xend-config.sxp.
diff -r ec3d0937095d -r 0942baa2a088 tools/examples/xmexample2
--- a/tools/examples/xmexample2 Fri Mar 06 19:10:29 2009 +0000
+++ b/tools/examples/xmexample2 Fri Mar 06 19:13:23 2009 +0000
@@ -109,29 +109,29 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
 #
 # To create one using the SDL backend and sensible defaults:
 #
-# vfb = [ 'type=sdl' ]
+# vfb = [ 'sdl=1' ]
 #
 # This uses environment variables XAUTHORITY and DISPLAY.  You
 # can override that:
 #
-# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+# vfb = [ 'sdl=1,xauthority=/home/bozo/.Xauthority,display=:1' ]
 #
 # To create one using the VNC backend and sensible defaults:
 #
-# vfb = [ 'type=vnc' ]
+# vfb = [ 'vnc=1' ]
 #
 # The backend listens on 127.0.0.1 port 5900+N by default, where N is
 # the domain ID.  You can override both address and N:
 #
-# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=%d' % vmid ]
+# vfb = [ 'vnc=1,vnclisten=127.0.0.1,vncdisplay=%d' % vmid ]
 #
 # Or you can bind the first unused port above 5900:
 #
-# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]
+# vfb = [ 'vnc=1,vnclisten=0.0.0.0,vncunused=1' ]
 #
 # You can override the password:
 #
-# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+# vfb = [ 'vnc=1,vncpasswd=MYPASSWD' ]
 #
 # Empty password disables authentication.  Defaults to the vncpasswd
 # configured in xend-config.sxp.
diff -r ec3d0937095d -r 0942baa2a088 tools/examples/xmexample3
--- a/tools/examples/xmexample3 Fri Mar 06 19:10:29 2009 +0000
+++ b/tools/examples/xmexample3 Fri Mar 06 19:13:23 2009 +0000
@@ -94,29 +94,29 @@ disk = [ 'phy:hda%d,hda1,w' % (vmid)]
 #
 # To create one using the SDL backend and sensible defaults:
 #
-# vfb = [ 'type=sdl' ]
+# vfb = [ 'sdl=1' ]
 #
 # This uses environment variables XAUTHORITY and DISPLAY.  You
 # can override that:
 #
-# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+# vfb = [ 'sdl=1,xauthority=/home/bozo/.Xauthority,display=:1' ]
 #
 # To create one using the VNC backend and sensible defaults:
 #
-# vfb = [ 'type=vnc' ]
+# vfb = [ 'vnc=1' ]
 #
 # The backend listens on 127.0.0.1 port 5900+N by default, where N is
 # the domain ID.  You can override both address and N:
 #
-# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=%d' % vmid ]
+# vfb = [ 'vnc=1,vnclisten=127.0.0.1,vncdisplay=%d' % vmid ]
 #
 # Or you can bind the first unused port above 5900:
 #
-# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]
+# vfb = [ 'vnc=1,vnclisten=0.0.0.0,vncunused=1' ]
 #
 # You can override the password:
 #
-# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+# vfb = [ 'vnc=1,vncpasswd=MYPASSWD' ]
 #
 # Empty password disables authentication.  Defaults to the vncpasswd
 # configured in xend-config.sxp.
diff -r ec3d0937095d -r 0942baa2a088 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Fri Mar 06 19:10:29 2009 +0000
+++ b/tools/python/xen/xend/XendConfig.py       Fri Mar 06 19:13:23 2009 +0000
@@ -174,7 +174,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
 
 # Xen API console 'other_config' keys.
 XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
-                            'vncpasswd', 'type', 'display', 'xauthority',
+                            'vncpasswd', 'sdl', 'vnc', 'display', 'xauthority',
                             'keymap', 'opengl']
 
 # List of XendConfig configuration keys that have no direct equivalent
@@ -865,7 +865,7 @@ class XendConfig(dict):
             # add vfb device if it isn't there already
             if not self.has_rfb():
                 dev_config = ['vfb']
-                dev_config.append(['type', 'vnc'])
+                dev_config.append(['vnc', '1'])
                 # copy VNC related params from platform config to vfb dev conf
                 for key in ['vncpasswd', 'vncunused', 'vncdisplay',
                             'vnclisten']:
@@ -1470,7 +1470,8 @@ class XendConfig(dict):
                     # collapse other config into devinfo for things
                     # such as vncpasswd, vncunused, etc.                    
                     dev_info.update(console_other_config)
-                    dev_info['type'] = console_other_config.get('type', 'vnc') 
+                    dev_info['vnc'] = console_other_config.get('vnc', '0')
+                    dev_info['sdl'] = console_other_config.get('sdl', '0')
                     target['devices'][dev_uuid] = ('vfb', dev_info)
                     target['console_refs'].append(dev_uuid)
 
diff -r ec3d0937095d -r 0942baa2a088 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Fri Mar 06 19:10:29 2009 +0000
+++ b/tools/python/xen/xend/image.py    Fri Mar 06 19:13:23 2009 +0000
@@ -279,15 +279,16 @@ class ImageHandler:
             if dev_type == 'vfb':
                 if 'keymap' in dev_info:
                     keymap = dev_info.get('keymap',{})
-                vfb_type = dev_info.get('type', {})
-                if vfb_type == 'sdl':
+                if int(dev_info.get('vnc', 0)) != 0 :
+                    has_vnc = True
+                if int(dev_info.get('sdl', 0)) != 0 :
+                    has_sdl = True
+                if has_sdl:
                     self.display = dev_info.get('display', {})
                     self.xauthority = dev_info.get('xauthority', {})
                     opengl = int(dev_info.get('opengl', opengl))
-                    has_sdl = True
-                else:
+                if has_vnc:
                     vnc_config = dev_info.get('other_config', {})
-                    has_vnc = True
                 break
 
         if keymap:
@@ -335,11 +336,12 @@ class ImageHandler:
             if int(vnc_config.get('vncunused', 1)) != 0:
                 ret.append('-vncunused')
 
-        elif has_sdl:
-            # SDL is default in QEMU.
+        if has_sdl:
+            ret.append('-sdl')
             if int(vmConfig['platform'].get('opengl', opengl)) != 1 :
                 ret.append('-disable-opengl')
-        else:
+
+        if not has_sdl and not has_vnc :
             ret.append('-nographic')
 
         if int(vmConfig['platform'].get('monitor', 0)) != 0:
@@ -714,6 +716,8 @@ class HVMImageHandler(ImageHandler):
 
         rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')
 
+        if not self.display :
+            self.display = ''
         self.vm.storeVm(("image/dmargs", " ".join(self.dmargs)),
                         ("image/device-model", self.device_model),
                         ("image/display", self.display))
diff -r ec3d0937095d -r 0942baa2a088 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Fri Mar 06 19:10:29 2009 +0000
+++ b/tools/python/xen/xm/create.py     Fri Mar 06 19:13:23 2009 +0000
@@ -350,16 +350,16 @@ gopts.var('irq', val='IRQ',
          For example 'irq=7'.
          This option may be repeated to add more than one IRQ.""")
 
-gopts.var('vfb', 
val="type={vnc,sdl},vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE",
+gopts.var('vfb', 
val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE",
           fn=append_value, default=[],
           use="""Make the domain a framebuffer backend.
-          The backend type should be either sdl or vnc.
-          For type=vnc, connect an external vncviewer.  The server will listen
+          Both sdl=1 and vnc=1 can be enabled at the same time.
+          For vnc=1, connect an external vncviewer.  The server will listen
           on ADDR (default 127.0.0.1) on port N+5900.  N defaults to the
           domain id.  If vncunused=1, the server will try to find an arbitrary
           unused port above 5900.  vncpasswd overrides the XenD configured
           default password.
-          For type=sdl, a viewer will be started automatically using the
+          For sdl=1, a viewer will be started automatically using the
           given DISPLAY and XAUTHORITY, which default to the current user's
           ones.  OpenGL will be used by default unless opengl is set to 0.
           keymap overrides the XendD configured default layout file.""")
@@ -804,11 +804,13 @@ def configure_vfbs(config_devs, vals):
     for f in vals.vfb:
         d = comma_sep_kv_to_dict(f)
         config = ['vfb']
-        if not d.has_key("type"):
-            d['type'] = 'sdl'
+        #handle the legacy case
+        if d.has_key("type"):
+            d[d['type']] = '1'
+            del d['type']
         for (k,v) in d.iteritems():
             if not k in [ 'vnclisten', 'vncunused', 'vncdisplay', 'display',
-                          'videoram', 'xauthority', 'type', 'vncpasswd',
+                          'videoram', 'xauthority', 'sdl', 'vnc', 'vncpasswd',
                           'opengl', 'keymap' ]:
                 err("configuration option %s unknown to vfbs" % k)
             config.append([k,v])

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.