[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: implement VM_hard_reboot of XenAPI.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1212482021 -3600
# Node ID 420db89188caafa5ee453407dce010a901abc2b8
# Parent  5c38568d90df668ce91649bbe2bf2105b27a949b
xend: implement VM_hard_reboot of XenAPI.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py |    6 ++++--
 tools/python/xen/xm/main.py      |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff -r 5c38568d90df -r 420db89188ca tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Tue Jun 03 09:32:50 2008 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Tue Jun 03 09:33:41 2008 +0100
@@ -1707,11 +1707,13 @@ class XendAPI(object):
                                      "domain_delete", vm_ref)
     
     def VM_hard_reboot(self, session, vm_ref):
-        return xen_api_error(XEND_ERROR_UNSUPPORTED)
+        return XendTask.log_progress(0, 100, do_vm_func,
+                                     "domain_reset", vm_ref)
     
     def VM_hard_shutdown(self, session, vm_ref):
         return XendTask.log_progress(0, 100, do_vm_func,
-                                     "domain_destroy", vm_ref)    
+                                     "domain_destroy", vm_ref)
+    
     def VM_pause(self, session, vm_ref):
         return XendTask.log_progress(0, 100, do_vm_func,
                                      "domain_pause", vm_ref)
diff -r 5c38568d90df -r 420db89188ca tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Jun 03 09:32:50 2008 +0100
+++ b/tools/python/xen/xm/main.py       Tue Jun 03 09:33:41 2008 +0100
@@ -1257,8 +1257,10 @@ def xm_reset(args):
     arg_check(args, "reset", 1)
     dom = args[0]
 
-    # TODO: XenAPI
-    server.xend.domain.reset(dom)
+    if serverType == SERVER_XEN_API:
+        server.xenapi.VM.hard_reboot(get_single_vm(dom))
+    else:
+        server.xend.domain.reset(dom)
 
 def xm_pause(args):
     arg_check(args, "pause", 1)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.