ia64/xen-unstable

changeset 14600:ebb8ad702157

Make xm sysrq work via XenAPI re: PAUSED state problem

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author Tom Wilkie <tom.wilkie@gmail.com>
date Tue Mar 27 15:47:02 2007 +0100 (2007-03-27)
parents cb7d02592b96
children 2864754a398f
files tools/python/xen/xend/XendAPI.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Tue Mar 27 17:23:33 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Tue Mar 27 15:47:02 2007 +0100
     1.3 @@ -1647,14 +1647,15 @@ class XendAPI(object):
     1.4  
     1.5      def VM_send_sysrq(self, _, vm_ref, req):
     1.6          xeninfo = XendDomain.instance().get_vm_by_uuid(vm_ref)
     1.7 -        if xeninfo.state != XEN_API_VM_POWER_STATE_RUNNING:
     1.8 +        if xeninfo.state == XEN_API_VM_POWER_STATE_RUNNING \
     1.9 +               or xeninfo.state == XEN_API_VM_POWER_STATE_PAUSED:
    1.10 +            xeninfo.send_sysrq(req)
    1.11 +            return xen_api_success_void()
    1.12 +        else:
    1.13              return xen_api_error(
    1.14                  ['VM_BAD_POWER_STATE', vm_ref,
    1.15                   XendDomain.POWER_STATE_NAMES[XEN_API_VM_POWER_STATE_RUNNING],
    1.16                   XendDomain.POWER_STATE_NAMES[xeninfo.state]])
    1.17 -        xeninfo.send_sysrq(req)
    1.18 -        return xen_api_success_void()
    1.19 -
    1.20  
    1.21      def VM_send_trigger(self, _, vm_ref, trigger, vcpu):
    1.22          xendom = XendDomain.instance()