ia64/xen-unstable

changeset 1733:3365c9a31041

bitkeeper revision 1.1063 (40eee3b3fhJcuCvug_gxZ26ZGxJG6Q)

Merge ssh://srg//auto/groups/xeno/BK/xeno.bk
into equilibrium.research.intel-research.net:/export/scratch/mwilli2/temp/xeno2.bk
author mwilli2@equilibrium.research.intel-research.net
date Fri Jul 09 18:28:03 2004 +0000 (2004-07-09)
parents 7f9e7fa78545 d353df1b15d2
children cda0735bdc4c
files .rootkeys tools/python/xen/xend/XendClient.py tools/python/xen/xend/XendDmesg.py tools/python/xen/xend/server/SrvDmesg.py tools/python/xen/xend/server/SrvRoot.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/.rootkeys	Fri Jul 09 15:13:35 2004 +0000
     1.2 +++ b/.rootkeys	Fri Jul 09 18:28:03 2004 +0000
     1.3 @@ -236,6 +236,7 @@ 40e15b7eeQxWE_hUPB2YTgM9fsZ1PQ tools/pyt
     1.4  40c9c4688m3eqnC8fhLu1APm36VOVA tools/python/xen/xend/XendClient.py
     1.5  40c9c468t6iIKTjwuYoe-UMCikDcOQ tools/python/xen/xend/XendConsole.py
     1.6  40c9c468WnXs6eOUSff23IIGI4kMfQ tools/python/xen/xend/XendDB.py
     1.7 +40eee3a0sPO-WUu34uHUXOC7HliDGw tools/python/xen/xend/XendDmesg.py
     1.8  40c9c468fSl3H3IypyT0ppkbb0ZT9A tools/python/xen/xend/XendDomain.py
     1.9  40c9c468bbKq3uC7_fuNUkiMMjArdw tools/python/xen/xend/XendDomainConfig.py
    1.10  40c9c4685ykq87_n1kVUbMr9flx9fg tools/python/xen/xend/XendDomainInfo.py
    1.11 @@ -251,6 +252,7 @@ 40c9c4689Io5bxfbYIfRiUvsiLX0EQ tools/pyt
    1.12  40c9c468woSmBByfeXA4o_jGf2gCgA tools/python/xen/xend/server/SrvDaemon.py
    1.13  40c9c468kACsmkqjxBWKHRo071L26w tools/python/xen/xend/server/SrvDeviceDir.py
    1.14  40c9c468EQZJVkCLds-OhesJVVyZbQ tools/python/xen/xend/server/SrvDir.py
    1.15 +40eee3a0m38EwYXfCSFIjWNwG6jx_A tools/python/xen/xend/server/SrvDmesg.py
    1.16  40c9c468TyHZUq8sk0FF_vxM6Sozrg tools/python/xen/xend/server/SrvDomain.py
    1.17  40c9c469WzajDjutou3X7FmL9hMf3g tools/python/xen/xend/server/SrvDomainDir.py
    1.18  40c9c469-8mYEJJTAR6w_ClrJRAfwQ tools/python/xen/xend/server/SrvEventDir.py
     2.1 --- a/tools/python/xen/xend/XendClient.py	Fri Jul 09 15:13:35 2004 +0000
     2.2 +++ b/tools/python/xen/xend/XendClient.py	Fri Jul 09 18:28:03 2004 +0000
     2.3 @@ -89,6 +89,9 @@ def vneturl(location, root, id=''):
     2.4  def eventurl(location, root, id=''):
     2.5      return urljoin(location, root, 'event/', id)
     2.6  
     2.7 +def dmesgurl(location, root, id=''):
     2.8 +    return urljoin(location, root, 'dmesg/', id)
     2.9 +
    2.10  def xend_request(url, method, data=None):
    2.11      """Make a request to xend.
    2.12  
    2.13 @@ -193,6 +196,9 @@ class Xend:
    2.14      def eventurl(self, id=''):
    2.15          return eventurl(self.location, self.root, id)
    2.16  
    2.17 +    def dmesgurl(self, id=''):
    2.18 +        return dmesgurl(self.location, self.root, id)
    2.19 +
    2.20      def xend(self):
    2.21          return xend_get(urljoin(self.location, self.root))
    2.22  
    2.23 @@ -329,6 +335,9 @@ class Xend:
    2.24      def xend_event_inject(self, sxpr):
    2.25          val = xend_call(self.eventurl(),
    2.26                          {'op': 'inject', 'event': fileof(sxpr) })
    2.27 +
    2.28 +    def xend_dmesg(self):
    2.29 +        return xend_get(self.dmesgurl())
    2.30      
    2.31  
    2.32  def main(argv):
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/python/xen/xend/XendDmesg.py	Fri Jul 09 18:28:03 2004 +0000
     3.3 @@ -0,0 +1,24 @@
     3.4 +# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
     3.5 +
     3.6 +"""Get dmesg output for this node.  Very basic right now!
     3.7 +"""
     3.8 +
     3.9 +import os
    3.10 +import xen.lowlevel.xc
    3.11 +
    3.12 +class XendDmesg:
    3.13 +    def __init__(self):
    3.14 +        self.xc = xen.lowlevel.xc.new()
    3.15 +
    3.16 +    def info(self):
    3.17 +        return [ self.xc.readconsolering() ]
    3.18 +        
    3.19 +
    3.20 +def instance():
    3.21 +    global inst
    3.22 +    try:
    3.23 +        inst
    3.24 +    except:
    3.25 +        inst = XendDmesg()
    3.26 +    return inst
    3.27 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/python/xen/xend/server/SrvDmesg.py	Fri Jul 09 18:28:03 2004 +0000
     4.3 @@ -0,0 +1,29 @@
     4.4 +# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
     4.5 +
     4.6 +import os
     4.7 +from SrvDir import SrvDir
     4.8 +from xen.xend import sxp
     4.9 +from xen.xend import XendDmesg
    4.10 +
    4.11 +class SrvDmesg(SrvDir):
    4.12 +    """Xen Dmesg output.
    4.13 +    """
    4.14 +
    4.15 +    def __init__(self):
    4.16 +        SrvDir.__init__(self)
    4.17 +        self.xd = XendDmesg.instance()
    4.18 +
    4.19 +    def render_GET(self, req):
    4.20 +        if self.use_sxp(req):
    4.21 +            req.setHeader("Content-Type", sxp.mime_type)
    4.22 +            sxp.show(['dmesg'] + self.info(), out=req)
    4.23 +        else:
    4.24 +            req.write('<html><head></head><body>')
    4.25 +            req.write('<pre>')
    4.26 +            self.print_path(req)
    4.27 +            req.write(self.info()[0])
    4.28 +            req.write('</pre></body></html>')
    4.29 +        return ''
    4.30 +            
    4.31 +    def info(self):
    4.32 +        return self.xd.info()
     5.1 --- a/tools/python/xen/xend/server/SrvRoot.py	Fri Jul 09 15:13:35 2004 +0000
     5.2 +++ b/tools/python/xen/xend/server/SrvRoot.py	Fri Jul 09 18:28:03 2004 +0000
     5.3 @@ -15,6 +15,7 @@ class SrvRoot(SrvDir):
     5.4      subdirs = [
     5.5          ('node',    'SrvNode'       ),
     5.6          ('domain',  'SrvDomainDir'  ),
     5.7 +        ('dmesg',   'SrvDmesg'      ),
     5.8          ('console', 'SrvConsoleDir' ),
     5.9          ('event',   'SrvEventDir'   ),
    5.10          ('device',  'SrvDeviceDir'  ),
     6.1 --- a/tools/python/xen/xm/main.py	Fri Jul 09 15:13:35 2004 +0000
     6.2 +++ b/tools/python/xen/xm/main.py	Fri Jul 09 18:28:03 2004 +0000
     6.3 @@ -503,5 +503,15 @@ can be omitted. See xen.xend.XendClient 
     6.4  
     6.5  xm.prog(ProgCall)
     6.6  
     6.7 +class ProgDmesg(Prog):
     6.8 +    group = 'host'
     6.9 +    name  =  "dmesg"
    6.10 +    info  = """Print Xen boot output."""
    6.11 +
    6.12 +    def main(self, args):
    6.13 +        print server.xend_dmesg()[1]
    6.14 +
    6.15 +xm.prog(ProgDmesg)
    6.16 +
    6.17  def main(args):
    6.18      xm.main(args)