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] Implement xm domid and xm console using t

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Implement xm domid and xm console using the Xen-API, and fix xm domname.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Mar 2007 05:30:19 -0700
Delivery-date: Thu, 15 Mar 2007 05:30:39 -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 1173914793 0
# Node ID 30a83a0839bd85c464347f30b388f0d8567ba6f0
# Parent  b39c0a79d4d5d90fd92efb148ad06198cd139f85
Implement xm domid and xm console using the Xen-API, and fix xm domname.

Signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
 tools/python/xen/xm/main.py |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff -r b39c0a79d4d5 -r 30a83a0839bd tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Mar 14 23:16:59 2007 +0000
+++ b/tools/python/xen/xm/main.py       Wed Mar 14 23:26:33 2007 +0000
@@ -1140,14 +1140,16 @@ def xm_destroy(args):
     else:
         server.xend.domain.destroy(dom)
 
-
 def xm_domid(args):
     arg_check(args, "domid", 1)
 
     name = args[0]
 
-    dom = server.xend.domain(name)
-    print sxp.child_value(dom, 'domid')
+    if serverType == SERVER_XEN_API:
+        print server.xenapi.VM.get_domid(get_single_vm(name))
+    else:
+        dom = server.xend.domain(name)
+        print sxp.child_value(dom, 'domid')
     
 def xm_domname(args):
     arg_check(args, "domname", 1)
@@ -1155,7 +1157,7 @@ def xm_domname(args):
     name = args[0]
     
     if serverType == SERVER_XEN_API:
-        print server.xenapi.VM.get_domid(get_single_vm(dom))
+        print server.xenapi.VM.get_name_label(get_single_vm(name))
     else:
         dom = server.xend.domain(name)
         print sxp.child_value(dom, 'name')
@@ -1384,13 +1386,17 @@ def xm_console(args):
     dom = params[0]
 
     try:
-        info = server.xend.domain(dom)
+        if serverType == SERVER_XEN_API:
+            domid = int(server.xenapi.VM.get_domid(get_single_vm(dom)))
+        else:
+            info = server.xend.domain(dom)
+            domid = int(sxp.child_value(info, 'domid', '-1'))
     except:
         if quiet:
             sys.exit(1)
         else:
             raise
-    domid = int(sxp.child_value(info, 'domid', '-1'))
+        
     if domid == -1:
         if quiet:
             sys.exit(1)

_______________________________________________
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] Implement xm domid and xm console using the Xen-API, and fix xm domname., Xen patchbot-unstable <=