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 Xen-API implementations for xm paus

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Added Xen-API implementations for xm pause, xm unpause, xm destroy, xm rename,
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 06 Dec 2006 22:10:21 +0000
Delivery-date: Wed, 06 Dec 2006 14:10:16 -0800
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>
# Node ID 26a3c7c1078243b682fdb703fc2b652919991be9
# Parent  795a87426e48062106f3d188c57859a5e89bd5cb
Added Xen-API implementations for xm pause, xm unpause, xm destroy, xm rename,
and fix xm suspend and xm delete.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xm/main.py |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff -r 795a87426e48 -r 26a3c7c10782 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Dec 06 11:24:37 2006 +0000
+++ b/tools/python/xen/xm/main.py       Wed Dec 06 11:25:51 2006 +0000
@@ -825,7 +825,7 @@ def xm_delete(args):
     arg_check(args, "delete", 1)
     dom = args[0]
     if serverType == SERVER_XEN_API:
-        server.xenapi.VM.destroy(dom)
+        server.xenapi.VM.destroy(get_single_vm(dom))
     else:
         server.xend.domain.delete(dom)
 
@@ -858,7 +858,7 @@ def xm_resume(args):
 
     dom = params[0]
     if serverType == SERVER_XEN_API:
-        server.xenapi.VM.resume(dom, paused)
+        server.xenapi.VM.resume(get_single_vm(dom), paused)
     else:
         server.xend.domain.resume(dom, paused)
     
@@ -876,13 +876,19 @@ def xm_pause(args):
     arg_check(args, "pause", 1)
     dom = args[0]
 
-    server.xend.domain.pause(dom)
+    if serverType == SERVER_XEN_API:
+        server.xenapi.VM.pause(get_single_vm(dom))
+    else:
+        server.xend.domain.pause(dom)
 
 def xm_unpause(args):
     arg_check(args, "unpause", 1)
     dom = args[0]
 
-    server.xend.domain.unpause(dom)
+    if serverType == SERVER_XEN_API:
+        server.xenapi.VM.unpause(get_single_vm(dom))
+    else:
+        server.xend.domain.unpause(dom)
 
 def xm_dump_core(args):
     live = False
@@ -923,7 +929,10 @@ def xm_rename(args):
 def xm_rename(args):
     arg_check(args, "rename", 2)
         
-    server.xend.domain.setName(args[0], args[1])
+    if serverType == SERVER_XEN_API:
+        server.xenapi.VM.set_name_label(get_single_vm(args[0]), args[1])
+    else:
+        server.xend.domain.setName(args[0], args[1])
 
 def xm_importcommand(command, args):
     cmd = __import__(command, globals(), locals(), 'xen.xm')
@@ -981,7 +990,12 @@ def xm_vcpu_set(args):
 
 def xm_destroy(args):
     arg_check(args, "destroy", 1)
-    server.xend.domain.destroy(args[0])
+
+    dom = args[0]
+    if serverType == SERVER_XEN_API:
+        server.xenapi.VM.hard_shutdown(get_single_vm(dom))
+    else:
+        server.xend.domain.destroy(dom)
 
 
 def xm_domid(args):

_______________________________________________
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 Xen-API implementations for xm pause, xm unpause, xm destroy, xm rename,, Xen patchbot-unstable <=