ia64/xen-unstable

changeset 2785:209dc445dc31

bitkeeper revision 1.1159.1.314 (418442e0ulgOgW7-GQoSm-dOij6jwg)

Add dmesg clear op.
author mark@maw48.kings.cam.ac.uk
date Sun Oct 31 01:41:52 2004 +0000 (2004-10-31)
parents 58a1c7dcf446
children 7aa5dc139305
files BitKeeper/etc/logging_ok tools/python/xen/xend/XendClient.py tools/python/xen/xend/XendDmesg.py tools/python/xen/xend/server/SrvDmesg.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/BitKeeper/etc/logging_ok	Sat Oct 30 14:38:11 2004 +0000
     1.2 +++ b/BitKeeper/etc/logging_ok	Sun Oct 31 01:41:52 2004 +0000
     1.3 @@ -32,6 +32,7 @@ kaf24@striker.cl.cam.ac.uk
     1.4  laudney@eclipse.(none)
     1.5  lynx@idefix.cl.cam.ac.uk
     1.6  mafetter@fleming.research
     1.7 +mark@maw48.kings.cam.ac.uk
     1.8  maw48@labyrinth.cl.cam.ac.uk
     1.9  mjw@wray-m-3.hpl.hp.com
    1.10  mwilli2@equilibrium.research
     2.1 --- a/tools/python/xen/xend/XendClient.py	Sat Oct 30 14:38:11 2004 +0000
     2.2 +++ b/tools/python/xen/xend/XendClient.py	Sun Oct 31 01:41:52 2004 +0000
     2.3 @@ -179,8 +179,12 @@ class Xend:
     2.4          return self.xendPost(self.nodeurl(),
     2.5                               {'op'      : 'reboot'})
     2.6  
     2.7 -    def xend_node_dmesg(self):
     2.8 -        return self.xendGet(self.nodeurl('dmesg'))
     2.9 +    def xend_node_get_dmesg(self):
    2.10 +            return self.xendGet(self.nodeurl('dmesg'))
    2.11 +
    2.12 +    def xend_node_clear_dmesg(self):
    2.13 +        return self.xendPost(self.nodeurl('dmesg'),
    2.14 +                             {'op' : 'clear' } )
    2.15  
    2.16      def xend_node_log(self):
    2.17          return self.xendGet(self.nodeurl('log'))
     3.1 --- a/tools/python/xen/xend/XendDmesg.py	Sat Oct 30 14:38:11 2004 +0000
     3.2 +++ b/tools/python/xen/xend/XendDmesg.py	Sun Oct 31 01:41:52 2004 +0000
     3.3 @@ -12,7 +12,9 @@ class XendDmesg:
     3.4  
     3.5      def info(self):
     3.6          return self.xc.readconsolering()
     3.7 -        
     3.8 +
     3.9 +    def clear(self):
    3.10 +        self.xc.readconsolering(True)
    3.11  
    3.12  def instance():
    3.13      global inst
     4.1 --- a/tools/python/xen/xend/server/SrvDmesg.py	Sat Oct 30 14:38:11 2004 +0000
     4.2 +++ b/tools/python/xen/xend/server/SrvDmesg.py	Sun Oct 31 01:41:52 2004 +0000
     4.3 @@ -15,6 +15,9 @@ class SrvDmesg(SrvDir):
     4.4          SrvDir.__init__(self)
     4.5          self.xd = XendDmesg.instance()
     4.6  
     4.7 +    def render_POST(self, req):
     4.8 +        self.perform(req)
     4.9 +
    4.10      def render_GET(self, req):
    4.11          try:
    4.12              if self.use_sxp(req):
    4.13 @@ -32,3 +35,6 @@ class SrvDmesg(SrvDir):
    4.14              
    4.15      def info(self):
    4.16          return self.xd.info()
    4.17 +
    4.18 +    def op_clear(self):
    4.19 +        self.xd.clear()
     5.1 --- a/tools/python/xen/xm/main.py	Sat Oct 30 14:38:11 2004 +0000
     5.2 +++ b/tools/python/xen/xm/main.py	Sun Oct 31 01:41:52 2004 +0000
     5.3 @@ -665,7 +665,12 @@ class ProgDmesg(Prog):
     5.4      info  = """Print Xen boot output."""
     5.5  
     5.6      def main(self, args):
     5.7 -        print server.xend_node_dmesg()
     5.8 +        if len(args) == 1:
     5.9 +            print server.xend_node_dmesg(clear)
    5.10 +        if len(args) > 1:
    5.11 +            if len(args) == 2 and args[1] == '-c':
    5.12 +                print server.xend_node_clear_dmesg()
    5.13 +            else: self.err("%s: Invalid argument" % args[0])
    5.14  
    5.15  xm.prog(ProgDmesg)
    5.16  
    5.17 @@ -726,7 +731,7 @@ class ProgVbdCreate(Prog):
    5.18  Create a virtual block device for a domain.
    5.19  
    5.20    UNAME   - device to export, e.g. phy:hda2
    5.21 -  DEV     - device name in the domain, e.g. xda1
    5.22 +  DEV     - device name in the domain, e.g. sda1
    5.23    MODE    - access mode: r for read, w for read-write
    5.24    BACKEND - backend driver domain
    5.25  """