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

[Xen-changelog] [xen-unstable] Added a new Xen-API call VM.send_sysrq, and use that to implement xm sysrq



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1173995974 0
# Node ID edccebeea4a3e75fb5b536c294c821cbd5435c08
# Parent  1c94d9fcb7efcf2899363f9486aa2657123fc85d
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@xxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py |    7 +++++++
 tools/python/xen/xm/main.py      |    5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff -r 1c94d9fcb7ef -r edccebeea4a3 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Thu Mar 15 21:44:20 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Thu Mar 15 21:59:34 2007 +0000
@@ -1070,6 +1070,7 @@ class XendAPI(object):
                   ('hard_reboot', None),
                   ('suspend', None),
                   ('resume', None),
+                  ('send_sysrq', None),
                   ('add_to_HVM_boot_params', None),
                   ('remove_from_HVM_boot_params', None),
                   ('add_to_VCPUs_params', None),
@@ -1513,6 +1514,12 @@ class XendAPI(object):
         return XendTask.log_progress(0, 100, do_vm_func,
                                      "domain_unpause", vm_ref)
 
+    def VM_send_sysrq(self, _, vm_ref, req):
+        xendom = XendDomain.instance()
+        xeninfo = xendom.get_vm_by_uuid(vm_ref)
+        xeninfo.send_sysrq(req)
+        return xen_api_success_void()
+
     # Xen API: Class VM_metrics
     # ----------------------------------------------------------------
 
diff -r 1c94d9fcb7ef -r edccebeea4a3 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Thu Mar 15 21:44:20 2007 +0000
+++ b/tools/python/xen/xm/main.py       Thu Mar 15 21:59:34 2007 +0000
@@ -1466,7 +1466,10 @@ def xm_sysrq(args):
     arg_check(args, "sysrq", 2)
     dom = args[0]
     req = args[1]
-    server.xend.domain.send_sysrq(dom, req)    
+    if serverType == SERVER_XEN_API:
+        server.xenapi.VM.send_sysrq(get_single_vm(dom), req)
+    else:
+        server.xend.domain.send_sysrq(dom, req)
 
 def xm_trigger(args):
     vcpu = 0

_______________________________________________
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®.