WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Added the clear flag to host.dmesg, and a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Added the clear flag to host.dmesg, and added host.get_log. Use these to
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Mar 2007 05:30:18 -0700
Delivery-date: Thu, 15 Mar 2007 05:30:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1173914219 0
# Node ID b39c0a79d4d5d90fd92efb148ad06198cd139f85
# Parent  8645c726ce9c63080fb5a1dd5534f6057f37016e
Added the clear flag to host.dmesg, and added host.get_log.  Use these to
implement xm dmesg and xm log using the Xen-API.

Signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py |   15 ++++++++++++---
 tools/python/xen/xm/main.py      |   28 ++++++++++++++++++++++------
 2 files changed, 34 insertions(+), 9 deletions(-)

diff -r 8645c726ce9c -r b39c0a79d4d5 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Wed Mar 14 23:14:19 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Wed Mar 14 23:16:59 2007 +0000
@@ -661,7 +661,8 @@ class XendAPI(object):
                     ('shutdown', None),
                     ('add_to_other_config', None),
                     ('remove_from_other_config', None),
-                    ('dmesg', 'String')]
+                    ('dmesg', 'String'),
+                    ('get_log', 'String')]
     
     host_funcs = [('get_by_name_label', 'Set(host)')]
 
@@ -737,8 +738,16 @@ class XendAPI(object):
             return xen_api_error(XEND_ERROR_HOST_RUNNING)
         return xen_api_error(XEND_ERROR_UNSUPPORTED)        
 
-    def host_dmesg(self, session, host_ref):
-        return xen_api_success(XendDmesg.instance().info())
+    def host_dmesg(self, session, host_ref, clear):
+        if clear:
+            return xen_api_success(XendDmesg.instance().clear())
+        else:
+            return xen_api_success(XendDmesg.instance().info())
+
+    def host_get_log(self, session, host_ref):
+        log_file = open(XendLogging.getLogFilename())
+        log_buffer = log_file.read()
+        return xen_api_success(log_buffer)
 
     def host_get_record(self, session, host_ref):
         node = XendNode.instance()
diff -r 8645c726ce9c -r b39c0a79d4d5 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Mar 14 23:14:19 2007 +0000
+++ b/tools/python/xen/xm/main.py       Wed Mar 14 23:16:59 2007 +0000
@@ -1498,17 +1498,33 @@ def xm_dmesg(args):
         err("No parameter required")
         usage('dmesg')
 
-    if not use_clear:
-        print server.xend.node.dmesg.info()
-    else:
-        server.xend.node.dmesg.clear()
+    if serverType == SERVER_XEN_API:
+        if not use_clear:
+            print server.xenapi.host.dmesg(
+                server.xenapi.session.get_this_host(),0)
+        else:
+            server.xenapi.host.dmesg(
+                server.xenapi.session.get_this_host(),1)
+    else:
+        if not use_clear:
+            print server.xend.node.dmesg.info()
+        else:
+            server.xend.node.dmesg.clear()
 
 def xm_log(args):
     arg_check(args, "log", 0)
-    
-    print server.xend.node.log()
+
+    if serverType == SERVER_XEN_API:
+        print server.xenapi.host.get_log(
+            server.xenapi.session.get_this_host())
+    else:
+        print server.xend.node.log()
 
 def xm_serve(args):
+    if serverType == SERVER_XEN_API:
+        print "Not supported with XenAPI"
+        sys.exit(-1)
+
     arg_check(args, "serve", 0)
 
     from fcntl import fcntl, F_SETFL

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Added the clear flag to host.dmesg, and added host.get_log. Use these to, Xen patchbot-unstable <=