ia64/xen-unstable
changeset 14430:edccebeea4a3
Added a new Xen-API call VM.send_sysrq, and use that to implement xm sysrq
through Xen-API.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
through Xen-API.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author | Ewan Mellor <ewan@xensource.com> |
---|---|
date | Thu Mar 15 21:59:34 2007 +0000 (2007-03-15) |
parents | 1c94d9fcb7ef |
children | 3c418dbb71b2 |
files | tools/python/xen/xend/XendAPI.py tools/python/xen/xm/main.py |
line diff
1.1 --- a/tools/python/xen/xend/XendAPI.py Thu Mar 15 21:44:20 2007 +0000 1.2 +++ b/tools/python/xen/xend/XendAPI.py Thu Mar 15 21:59:34 2007 +0000 1.3 @@ -1070,6 +1070,7 @@ class XendAPI(object): 1.4 ('hard_reboot', None), 1.5 ('suspend', None), 1.6 ('resume', None), 1.7 + ('send_sysrq', None), 1.8 ('add_to_HVM_boot_params', None), 1.9 ('remove_from_HVM_boot_params', None), 1.10 ('add_to_VCPUs_params', None), 1.11 @@ -1513,6 +1514,12 @@ class XendAPI(object): 1.12 return XendTask.log_progress(0, 100, do_vm_func, 1.13 "domain_unpause", vm_ref) 1.14 1.15 + def VM_send_sysrq(self, _, vm_ref, req): 1.16 + xendom = XendDomain.instance() 1.17 + xeninfo = xendom.get_vm_by_uuid(vm_ref) 1.18 + xeninfo.send_sysrq(req) 1.19 + return xen_api_success_void() 1.20 + 1.21 # Xen API: Class VM_metrics 1.22 # ---------------------------------------------------------------- 1.23
2.1 --- a/tools/python/xen/xm/main.py Thu Mar 15 21:44:20 2007 +0000 2.2 +++ b/tools/python/xen/xm/main.py Thu Mar 15 21:59:34 2007 +0000 2.3 @@ -1466,7 +1466,10 @@ def xm_sysrq(args): 2.4 arg_check(args, "sysrq", 2) 2.5 dom = args[0] 2.6 req = args[1] 2.7 - server.xend.domain.send_sysrq(dom, req) 2.8 + if serverType == SERVER_XEN_API: 2.9 + server.xenapi.VM.send_sysrq(get_single_vm(dom), req) 2.10 + else: 2.11 + server.xend.domain.send_sysrq(dom, req) 2.12 2.13 def xm_trigger(args): 2.14 vcpu = 0