From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH 2 of 5] xenconsole support for multiple consoles
Date: Thu, 11 Jun 2009 16:07:55 +0100 [thread overview]
Message-ID: <4A311DCB.10006@eu.citrix.com> (raw)
This patch adds a new command line argument to xenconsole to specify to
which console to connect to in case a domain has more than one.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
diff -r 9d09062e0562 stubdom/stubdom-dm
--- a/stubdom/stubdom-dm Thu Jun 11 15:24:27 2009 +0100
+++ b/stubdom/stubdom-dm Thu Jun 11 16:06:16 2009 +0100
@@ -52,6 +52,10 @@
keymap=$2
shift
;;
+ -serial)
+ serial="$2"
+ shift
+ ;;
esac
fi
case "$1" in
@@ -100,6 +104,7 @@
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 "$serial" && vfb="$vfb, serial=$serial"
echo "vfb = ['$vfb']" >> /etc/xen/stubdoms/$domname-dm
echo -n "disk = [ " >> /etc/xen/stubdoms/$domname-dm
diff -r 9d09062e0562 tools/examples/xmexample.hvm-stubdom
--- a/tools/examples/xmexample.hvm-stubdom Thu Jun 11 15:24:27 2009 +0100
+++ b/tools/examples/xmexample.hvm-stubdom Thu Jun 11 16:06:16 2009 +0100
@@ -177,10 +177,12 @@
#-----------------------------------------------------------------------------
# serial port re-direct to pty deivce, /dev/pts/n
-# then xm console or minicom can connect
+# then xm console or minicom can connect.
+# In the stubdoms case this option adds a secondary console to the
+# stubdom because there is always one for logging.
+# To connect to the guest serial you can use "xm console -n 1"
+# followed by the domain name of the stubdom.
#
-# STUBDOM: always disable as the stub domain doesn't have access to dom0's
-# ptys
#serial='pty'
diff -r 9d09062e0562 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py Thu Jun 11 15:24:27 2009 +0100
+++ b/tools/python/xen/xend/XendConfig.py Thu Jun 11 16:06:16 2009 +0100
@@ -1433,6 +1433,16 @@
del dev_info['type']
log.debug("iwj dev_type=%s vfb setting dev_info['%s']" %
(dev_type, vfb_type))
+ 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')
+ 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)
elif dev_type == 'console':
if 'console_refs' not in target:
diff -r 9d09062e0562 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Thu Jun 11 15:24:27 2009 +0100
+++ b/tools/python/xen/xend/image.py Thu Jun 11 16:06:16 2009 +0100
@@ -286,6 +286,9 @@
if dev_type == 'vfb':
if 'keymap' in dev_info:
keymap = dev_info.get('keymap',{})
+ if 'serial' in dev_info:
+ ret.append("-serial")
+ ret.append(dev_info.get('serial',{}))
if int(dev_info.get('vnc', 0)) != 0 :
has_vnc = True
if int(dev_info.get('sdl', 0)) != 0 :
@@ -746,12 +749,10 @@
if not self.display :
self.display = ''
- # Do not store sdl, opengl and serial related qemu cli options
+ # 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"
- and x != "-serial"
- and x != "pty" ])),
+ and x != "-disable-opengl" ])),
("image/device-model", self.device_model),
("image/display", self.display))
self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } )
diff -r 9d09062e0562 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py Thu Jun 11 15:24:27 2009 +0100
+++ b/tools/python/xen/xm/create.py Thu Jun 11 16:06:16 2009 +0100
@@ -352,7 +352,7 @@
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",
+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",
fn=append_value, default=[],
use="""Make the domain a framebuffer backend.
Both sdl=1 and vnc=1 can be enabled at the same time.
@@ -364,7 +364,8 @@
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.""")
+ keymap overrides the XendD configured default layout file.
+ Serial adds a second serial support to qemu.""")
gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \
"backend=DOM,vifname=NAME,rate=RATE,model=MODEL,accel=ACCEL",
@@ -827,7 +828,7 @@
for (k,v) in d.iteritems():
if not k in [ 'vnclisten', 'vncunused', 'vncdisplay', 'display',
'videoram', 'xauthority', 'sdl', 'vnc', 'vncpasswd',
- 'opengl', 'keymap' ]:
+ 'opengl', 'keymap', 'serial' ]:
err("configuration option %s unknown to vfbs" % k)
config.append([k,v])
if not d.has_key("keymap"):
next reply other threads:[~2009-06-11 15:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 15:07 Stefano Stabellini [this message]
2009-06-11 15:10 ` [PATCH 2 of 5] xenconsole support for multiple consoles Stefano Stabellini
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=4A311DCB.10006@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--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.