mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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>
This commit is contained in:
1 parent
8f771d00bf
commit
d914b94a3f
4 files changed
+36
-15
No files matched your search
@@ -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'] = []
|
||||
|
||||
@@ -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 } )
|
||||
|
||||
@@ -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"):
|
||||
|
||||