mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xenconsole: support for multiple consoles per domain
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>
This commit is contained in:
1 parent
f84ee327e5
commit
c811d0d548
3 files changed
+27
-19
No files matched your search
@@ -24,8 +24,8 @@ from xen.util import utils
|
||||
|
||||
XENCONSOLE = "xenconsole"
|
||||
|
||||
def execConsole(domid):
|
||||
xen.util.auxbin.execute(XENCONSOLE, [str(domid)])
|
||||
def execConsole(domid, num = 0):
|
||||
xen.util.auxbin.execute(XENCONSOLE, [str(domid), "--num", str(num)])
|
||||
|
||||
|
||||
class OurXenstoreConnection:
|
||||
|
||||
@@ -1779,12 +1779,13 @@ def xm_info(args):
|
||||
print "%-23s:" % x[0], x[1]
|
||||
|
||||
def xm_console(args):
|
||||
arg_check(args, "console", 1, 2)
|
||||
arg_check(args, "console", 1, 3)
|
||||
|
||||
num = 0
|
||||
quiet = False;
|
||||
|
||||
try:
|
||||
(options, params) = getopt.gnu_getopt(args, 'q', ['quiet'])
|
||||
(options, params) = getopt.gnu_getopt(args, 'qn:', ['quiet', 'num'])
|
||||
except getopt.GetoptError, opterr:
|
||||
err(opterr)
|
||||
usage('console')
|
||||
@@ -1792,6 +1793,8 @@ def xm_console(args):
|
||||
for (k, v) in options:
|
||||
if k in ['-q', '--quiet']:
|
||||
quiet = True
|
||||
elif k in ['-n', '--num']:
|
||||
num = int(v[0])
|
||||
else:
|
||||
assert False
|
||||
|
||||
@@ -1819,7 +1822,7 @@ def xm_console(args):
|
||||
else:
|
||||
raise xmlrpclib.Fault(0, "Domain '%s' is not started" % dom)
|
||||
|
||||
console.execConsole(domid)
|
||||
console.execConsole(domid, num)
|
||||
|
||||
|
||||
def domain_name_to_domid(domain_name):
|
||||
|
||||