diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-06-18 10:20:17 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-06-18 10:20:17 +0100 |
commit | d914b94a3f272e29be3137517f3665844e9442a4 (patch) | |
tree | 3fba3f99609db168cd5cad5ee4c2130f6a2eb718 | |
parent | 8f771d00bf535e52baa3864b06451a820de598a1 (diff) | |
download | xen-d914b94a3f272e29be3137517f3665844e9442a4.tar.gz xen-d914b94a3f272e29be3137517f3665844e9442a4.tar.bz2 xen-d914b94a3f272e29be3137517f3665844e9442a4.zip |
stubdoms: qemu monitor support
Add support for the qemu monitor in a stubdom, the same way the
emulated serial support was added few days ago. The stubdom exports
the monitor as a pty and minios opens a console frontend; qemu in dom0
provides the correspondent backend for this additional pv console that
happens to be the qemu monitor.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-rw-r--r-- | stubdom/stubdom-dm | 5 | ||||
-rw-r--r-- | tools/python/xen/xend/XendConfig.py | 18 | ||||
-rw-r--r-- | tools/python/xen/xend/image.py | 21 | ||||
-rw-r--r-- | tools/python/xen/xm/create.py | 7 |
4 files changed, 36 insertions, 15 deletions
diff --git a/stubdom/stubdom-dm b/stubdom/stubdom-dm index 956c1dbd9c..5161e1d0ee 100644 --- a/stubdom/stubdom-dm +++ b/stubdom/stubdom-dm @@ -56,6 +56,10 @@ do serial="$2" shift ;; + -monitor) + monitor="$2" + shift + ;; esac fi case "$1" in @@ -104,6 +108,7 @@ test $vnc != 0 && vfb="$vfb, vnc=$vnc, vncdisplay=$vnc_port, vnclisten=$ip, vncu vncpasswd=`xenstore-read /local/domain/0/backend/vfb/$domid/0/vncpasswd 2>/dev/null` test "$vncpasswd" && vfb="$vfb, vncpasswd=$vncpasswd" test "$keymap" && vfb="$vfb, keymap=$keymap" +test "$monitor" && vfb="$vfb, monitor=$monitor" test "$serial" && vfb="$vfb, serial=$serial" echo "vfb = ['$vfb']" >> /etc/xen/stubdoms/$domname-dm diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 41c75da301..8b718deb3a 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -1434,17 +1434,21 @@ class XendConfig(dict): del dev_info['type'] log.debug("iwj dev_type=%s vfb setting dev_info['%s']" % (dev_type, vfb_type)) + # Create serial backends now, the location value is bogus, but does not matter + i=0 + chardev=0 if dev_info.get('serial') is not None : - # Create two serial backends now, the location value is bogus, but does not matter - cfg = self.console_add('vt100', '0') + chardev = chardev + 1 + if dev_info.get('monitor') is not None : + chardev = chardev + 1 + if chardev > 0 : + chardev = chardev + 1 + while i < chardev : + cfg = self.console_add('vt100', str(i)) c_uuid = uuid.createString() target['devices'][c_uuid] = ('console', cfg) target['console_refs'].append(c_uuid) - cfg = self.console_add('vt100', '1') - c_uuid = uuid.createString() - target['devices'][c_uuid] = ('console', cfg) - target['console_refs'].append(c_uuid) - + i = i + 1 elif dev_type == 'console': if 'console_refs' not in target: target['console_refs'] = [] diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index a398f694d3..6bbe1ece87 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -286,6 +286,11 @@ class ImageHandler: if dev_type == 'vfb': if 'keymap' in dev_info: keymap = dev_info.get('keymap',{}) + if 'monitor' in dev_info: + ret.append("-serial") + ret.append(dev_info.get('monitor',{})) + ret.append("-monitor") + ret.append("null") if 'serial' in dev_info: ret.append("-serial") ret.append(dev_info.get('serial',{})) @@ -717,7 +722,7 @@ class LinuxImageHandler(ImageHandler): ret = ImageHandler.parseDeviceModelArgs(self, vmConfig) # Equivalent to old xenconsoled behaviour. Should make # it configurable in future - ret = ret + ["-serial", "pty"] + ret = ["-serial", "pty"] + ret return ret def getDeviceModelArgs(self, restore = False): @@ -749,10 +754,16 @@ class HVMImageHandler(ImageHandler): if not self.display : self.display = '' - # Do not store sdl and opengl qemu cli options - self.vm.storeVm(("image/dmargs", " ".join([ x for x in self.dmargs - if x != "-sdl" - and x != "-disable-opengl" ])), + + store_dmargs = self.dmargs[:] + store_dmargs.remove('-sdl') + store_dmargs.remove('-disable-opengl') + try : + midx = store_dmargs.index('-monitor') + store_dmargs[midx + 1] = 'pty' + except ValueError : + pass + self.vm.storeVm(("image/dmargs", " ".join(store_dmargs)), ("image/device-model", self.device_model), ("image/display", self.display)) self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } ) diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index 7104fe1b4d..e1fad288cb 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -354,7 +354,7 @@ gopts.var('irq', val='IRQ', For example 'irq=7'. This option may be repeated to add more than one IRQ.""") -gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,display=DISPLAY,xauthority=XAUTHORITY,vncpasswd=PASSWORD,opengl=1,keymap=FILE,serial=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,serial=FILE,monitor=FILE", fn=append_value, default=[], use="""Make the domain a framebuffer backend. Both sdl=1 and vnc=1 can be enabled at the same time. @@ -367,7 +367,8 @@ gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,displa 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. - Serial adds a second serial support to qemu.""") + Serial adds a second serial support to qemu. + Monitor adds a backend for the stubdom monitor.""") gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \ "backend=DOM,vifname=NAME,rate=RATE,model=MODEL,accel=ACCEL", @@ -815,7 +816,7 @@ def configure_vfbs(config_devs, vals): for (k,v) in d.iteritems(): if not k in [ 'vnclisten', 'vncunused', 'vncdisplay', 'display', 'videoram', 'xauthority', 'sdl', 'vnc', 'vncpasswd', - 'opengl', 'keymap', 'serial' ]: + 'opengl', 'keymap', 'serial', 'monitor' ]: err("configuration option %s unknown to vfbs" % k) config.append([k,v]) if not d.has_key("keymap"): |