ia64/xen-unstable

changeset 1901:dad2f070529a

bitkeeper revision 1.1108.14.2 (4104d6a3pjdnDffuzgjAIWgWEDohww)

Fix console destroy and formatting in xm.
author mjw@wray-m-3.hpl.hp.com
date Mon Jul 26 10:02:11 2004 +0000 (2004-07-26)
parents 3548afc2425d
children 664b8c51ecaa
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Mon Jul 26 09:32:17 2004 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Mon Jul 26 10:02:11 2004 +0000
     1.3 @@ -553,8 +553,11 @@ class XendDomainInfo:
     1.4          devices have been released.
     1.5          """
     1.6          if self.dom is None: return 0
     1.7 -        if self.restart_state == STATE_RESTART_PENDING and self.console:
     1.8 -            self.console.deregisterChannel()
     1.9 +        if self.console:
    1.10 +            if self.restart_pending():
    1.11 +                self.console.deregisterChannel()
    1.12 +            else:
    1.13 +                self.console.close()
    1.14          chan = xend.getDomChannel(self.dom)
    1.15          if chan:
    1.16              log.debug("Closing channel to domain %d", self.dom)
     2.1 --- a/tools/python/xen/xm/main.py	Mon Jul 26 09:32:17 2004 +0000
     2.2 +++ b/tools/python/xen/xm/main.py	Mon Jul 26 10:02:11 2004 +0000
     2.3 @@ -469,14 +469,19 @@ class ProgConsoles(Prog):
     2.4  
     2.5      def main(self, args):
     2.6          l = server.xend_consoles()
     2.7 -        print "Dom Port  Id"
     2.8 +        print "Dom Port  Id Connection"
     2.9          for x in l:
    2.10              info = server.xend_console(x)
    2.11              d = {}
    2.12 -            d['dom'] = sxp.child(info, 'dst', ['dst', '?', '?'])[1]
    2.13 -            d['port'] = sxp.child_value(info, 'port', '?')
    2.14 +            d['dom'] = sxp.child(info, 'domain', '?')[1]
    2.15 +            d['port'] = sxp.child_value(info, 'console_port', '?')
    2.16              d['id'] = sxp.child_value(info, 'id', '?')
    2.17 -            print "%(dom)3s %(port)4s %(id)3s" % d
    2.18 +            connected = sxp.child(info, 'connected')
    2.19 +            if connected:
    2.20 +                d['conn'] = '%s:%s' % (connected[1], connected[2])
    2.21 +            else:
    2.22 +                d['conn'] = ''
    2.23 +            print "%(dom)3s %(port)4s %(id)3s %(conn)s" % d
    2.24  
    2.25  xm.prog(ProgConsoles)
    2.26  
    2.27 @@ -496,7 +501,7 @@ class ProgConsole(Prog):
    2.28          console = sxp.child(info, "console")
    2.29          if not console:
    2.30              self.err("No console information")
    2.31 -        port = sxp.child_value(console, "port")
    2.32 +        port = sxp.child_value(console, "console_port")
    2.33          from xen.util import console_client
    2.34          console_client.connect("localhost", int(port))
    2.35