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] xm: Print xend config via 'xm info --conf

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xm: Print xend config via 'xm info --config'.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 01 Oct 2007 03:10:19 -0700
Delivery-date: Mon, 01 Oct 2007 03:28:00 -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 Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1191217140 -3600
# Node ID 5c7afb32df999ceca475f6582e3df3d7ff42d2fe
# Parent  0416abdd0efd0be99edbc6337e3a8e5ef59a76ea
xm: Print xend config via 'xm info --config'.
Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
---
 tools/python/xen/xm/main.py |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletion(-)

diff -r 0416abdd0efd -r 5c7afb32df99 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Mon Oct 01 06:36:25 2007 +0100
+++ b/tools/python/xen/xm/main.py       Mon Oct 01 06:39:00 2007 +0100
@@ -55,6 +55,9 @@ from xen.util.acmpolicy import ACM_LABEL
 
 import XenAPI
 
+import inspect
+from xen.xend import XendOptions
+xoptions = XendOptions.instance()
 
 # getopt.gnu_getopt is better, but only exists in Python 2.3+.  Use
 # getopt.getopt if gnu_getopt is not available.  This will mean that options
@@ -1595,7 +1598,31 @@ def xm_sched_credit(args):
                 err(str(result))
 
 def xm_info(args):
-    arg_check(args, "info", 0)
+    arg_check(args, "info", 0, 1)
+    
+    try:
+        (options, params) = getopt.gnu_getopt(args, 'c', ['config'])
+    except getopt.GetoptError, opterr:
+        err(opterr)
+        usage('info')
+    
+    show_xend_config = 0
+    for (k, v) in options:
+        if k in ['-c', '--config']:
+            show_xend_config = 1
+
+    if show_xend_config:
+        for name, obj in inspect.getmembers(xoptions):
+            if not inspect.ismethod(obj):
+                if name == "config":
+                    for x in obj[1:]:
+                        if len(x) < 2: 
+                            print "%-38s: (none)" % x[0]
+                        else: 
+                            print "%-38s:" % x[0], x[1]
+                else:
+                    print "%-38s:" % name, obj
+        return
 
     if serverType == SERVER_XEN_API:
 

_______________________________________________
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] xm: Print xend config via 'xm info --config'., Xen patchbot-unstable <=