Raise the VM_BAD_POWER_STATE error with VM.send_sysrq if the domain is not

running.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
Ewan Mellor committed 2007-03-15 22:15:12 +00:00
1 parent 746900680c
commit 77afb8b283
1 file changed
+7 -2
+7 -2
View File
@@ -1515,11 +1515,16 @@ class XendAPI(object):
"domain_unpause", vm_ref)
def VM_send_sysrq(self, _, vm_ref, req):
xendom = XendDomain.instance()
xeninfo = xendom.get_vm_by_uuid(vm_ref)
xeninfo = XendDomain.instance().get_vm_by_uuid(vm_ref)
if xeninfo.state != XEN_API_VM_POWER_STATE_RUNNING:
return xen_api_error(
['VM_BAD_POWER_STATE', vm_ref,
XendDomain.POWER_STATE_NAMES[XEN_API_VM_POWER_STATE_RUNNING],
XendDomain.POWER_STATE_NAMES[xeninfo.state]])
xeninfo.send_sysrq(req)
return xen_api_success_void()
# Xen API: Class VM_metrics
# ----------------------------------------------------------------
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.