mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
bitkeeper revision 1.1040.1.1 (40eee3a1eT0YAFxR2Vicy8vFSyHwSg)
Support for Xen console ring output.
This commit is contained in:
1 parent
1b765c26bc
commit
53e4b27700
6 files changed
+75
No files matched your search
@@ -252,6 +252,7 @@
|
||||
40c9c4688m3eqnC8fhLu1APm36VOVA tools/python/xen/xend/XendClient.py
|
||||
40c9c468t6iIKTjwuYoe-UMCikDcOQ tools/python/xen/xend/XendConsole.py
|
||||
40c9c468WnXs6eOUSff23IIGI4kMfQ tools/python/xen/xend/XendDB.py
|
||||
40eee3a0sPO-WUu34uHUXOC7HliDGw tools/python/xen/xend/XendDmesg.py
|
||||
40c9c468fSl3H3IypyT0ppkbb0ZT9A tools/python/xen/xend/XendDomain.py
|
||||
40c9c468bbKq3uC7_fuNUkiMMjArdw tools/python/xen/xend/XendDomainConfig.py
|
||||
40c9c4685ykq87_n1kVUbMr9flx9fg tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -267,6 +268,7 @@
|
||||
40c9c468woSmBByfeXA4o_jGf2gCgA tools/python/xen/xend/server/SrvDaemon.py
|
||||
40c9c468kACsmkqjxBWKHRo071L26w tools/python/xen/xend/server/SrvDeviceDir.py
|
||||
40c9c468EQZJVkCLds-OhesJVVyZbQ tools/python/xen/xend/server/SrvDir.py
|
||||
40eee3a0m38EwYXfCSFIjWNwG6jx_A tools/python/xen/xend/server/SrvDmesg.py
|
||||
40c9c468TyHZUq8sk0FF_vxM6Sozrg tools/python/xen/xend/server/SrvDomain.py
|
||||
40c9c469WzajDjutou3X7FmL9hMf3g tools/python/xen/xend/server/SrvDomainDir.py
|
||||
40c9c469-8mYEJJTAR6w_ClrJRAfwQ tools/python/xen/xend/server/SrvEventDir.py
|
||||
|
||||
@@ -79,6 +79,9 @@ def vneturl(location, root, id=''):
|
||||
def eventurl(location, root, id=''):
|
||||
return urljoin(location, root, 'event/', id)
|
||||
|
||||
def dmesgurl(location, root, id=''):
|
||||
return urljoin(location, root, 'dmesg/', id)
|
||||
|
||||
def xend_request(url, method, data=None):
|
||||
urlinfo = urlparse.urlparse(url)
|
||||
(uproto, ulocation, upath, uparam, uquery, ufrag) = urlinfo
|
||||
@@ -160,6 +163,9 @@ class Xend:
|
||||
def eventurl(self, id=''):
|
||||
return eventurl(self.location, self.root, id)
|
||||
|
||||
def dmesgurl(self, id=''):
|
||||
return dmesgurl(self.location, self.root, id)
|
||||
|
||||
def xend(self):
|
||||
return xend_get(urljoin(self.location, self.root))
|
||||
|
||||
@@ -281,6 +287,9 @@ class Xend:
|
||||
def xend_event_inject(self, sxpr):
|
||||
val = xend_call(self.eventurl(),
|
||||
{'op': 'inject', 'event': fileof(sxpr) })
|
||||
|
||||
def xend_dmesg(self):
|
||||
return xend_get(self.dmesgurl())
|
||||
|
||||
|
||||
def main(argv):
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
"""Get dmesg output for this node. Very basic right now!
|
||||
"""
|
||||
|
||||
import os
|
||||
import xen.lowlevel.xc
|
||||
|
||||
class XendDmesg:
|
||||
def __init__(self):
|
||||
self.xc = xen.lowlevel.xc.new()
|
||||
|
||||
def info(self):
|
||||
return [ self.xc.readconsolering() ]
|
||||
|
||||
|
||||
def instance():
|
||||
global inst
|
||||
try:
|
||||
inst
|
||||
except:
|
||||
inst = XendDmesg()
|
||||
return inst
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
import os
|
||||
from SrvDir import SrvDir
|
||||
from xen.xend import sxp
|
||||
from xen.xend import XendDmesg
|
||||
|
||||
class SrvDmesg(SrvDir):
|
||||
"""Xen Dmesg output.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
SrvDir.__init__(self)
|
||||
self.xd = XendDmesg.instance()
|
||||
|
||||
def render_GET(self, req):
|
||||
if self.use_sxp(req):
|
||||
req.setHeader("Content-Type", sxp.mime_type)
|
||||
sxp.show(['dmesg'] + self.info(), out=req)
|
||||
else:
|
||||
req.write('<html><head></head><body>')
|
||||
req.write('<pre>')
|
||||
self.print_path(req)
|
||||
req.write(self.info()[0])
|
||||
req.write('</pre></body></html>')
|
||||
return ''
|
||||
|
||||
def info(self):
|
||||
return self.xd.info()
|
||||
@@ -15,6 +15,7 @@ class SrvRoot(SrvDir):
|
||||
subdirs = [
|
||||
('node', 'SrvNode' ),
|
||||
('domain', 'SrvDomainDir' ),
|
||||
('dmesg', 'SrvDmesg' ),
|
||||
('console', 'SrvConsoleDir' ),
|
||||
('event', 'SrvEventDir' ),
|
||||
('device', 'SrvDeviceDir' ),
|
||||
|
||||
@@ -444,5 +444,15 @@ class ProgConsole(Prog):
|
||||
|
||||
xm.prog(ProgConsole)
|
||||
|
||||
class ProgDmesg(Prog):
|
||||
group = 'host'
|
||||
name = "dmesg"
|
||||
info = """Print Xen boot output."""
|
||||
|
||||
def main(self, args):
|
||||
print server.xend_dmesg()[1]
|
||||
|
||||
xm.prog(ProgDmesg)
|
||||
|
||||
def main(args):
|
||||
xm.main(args)
|
||||