ia64/xen-unstable

changeset 17780:420db89188ca

xend: implement VM_hard_reboot of XenAPI.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 03 09:33:41 2008 +0100 (2008-06-03)
parents 5c38568d90df
children 6b77c311fd3c
files tools/python/xen/xend/XendAPI.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Tue Jun 03 09:32:50 2008 +0100
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Tue Jun 03 09:33:41 2008 +0100
     1.3 @@ -1707,11 +1707,13 @@ class XendAPI(object):
     1.4                                       "domain_delete", vm_ref)
     1.5      
     1.6      def VM_hard_reboot(self, session, vm_ref):
     1.7 -        return xen_api_error(XEND_ERROR_UNSUPPORTED)
     1.8 +        return XendTask.log_progress(0, 100, do_vm_func,
     1.9 +                                     "domain_reset", vm_ref)
    1.10      
    1.11      def VM_hard_shutdown(self, session, vm_ref):
    1.12          return XendTask.log_progress(0, 100, do_vm_func,
    1.13 -                                     "domain_destroy", vm_ref)    
    1.14 +                                     "domain_destroy", vm_ref)
    1.15 +    
    1.16      def VM_pause(self, session, vm_ref):
    1.17          return XendTask.log_progress(0, 100, do_vm_func,
    1.18                                       "domain_pause", vm_ref)
     2.1 --- a/tools/python/xen/xm/main.py	Tue Jun 03 09:32:50 2008 +0100
     2.2 +++ b/tools/python/xen/xm/main.py	Tue Jun 03 09:33:41 2008 +0100
     2.3 @@ -1257,8 +1257,10 @@ def xm_reset(args):
     2.4      arg_check(args, "reset", 1)
     2.5      dom = args[0]
     2.6  
     2.7 -    # TODO: XenAPI
     2.8 -    server.xend.domain.reset(dom)
     2.9 +    if serverType == SERVER_XEN_API:
    2.10 +        server.xenapi.VM.hard_reboot(get_single_vm(dom))
    2.11 +    else:
    2.12 +        server.xend.domain.reset(dom)
    2.13  
    2.14  def xm_pause(args):
    2.15      arg_check(args, "pause", 1)