# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1174411852 0
# Node ID ee06d8b5712f7fd35f572f3182da160f915d691b
# Parent 9f9d04ce1eaf37d5925cfd5fb434fe0e10bfb786
Make xm trigger talk XenAPI; add send_trigger to VM class.
Signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
tools/python/xen/xend/XendAPI.py | 10 +++++++++-
tools/python/xen/xm/main.py | 7 +++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff -r 9f9d04ce1eaf -r ee06d8b5712f tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py Tue Mar 20 17:30:05 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py Tue Mar 20 17:30:52 2007 +0000
@@ -1087,7 +1087,8 @@ class XendAPI(object):
('add_to_platform', None),
('remove_from_platform', None),
('add_to_other_config', None),
- ('remove_from_other_config', None)]
+ ('remove_from_other_config', None),
+ ('send_trigger', None)]
VM_funcs = [('create', 'VM'),
('get_by_name_label', 'Set(VM)')]
@@ -1534,6 +1535,13 @@ class XendAPI(object):
return xen_api_success_void()
+ def VM_send_trigger(self, _, vm_ref, trigger, vcpu):
+ xendom = XendDomain.instance()
+ xeninfo = xendom.get_vm_by_uuid(vm_ref)
+ xendom.domain_send_trigger(xeninfo.getDomid(), trigger, vcpu)
+ return xen_api_success_void()
+
+
# Xen API: Class VM_metrics
# ----------------------------------------------------------------
diff -r 9f9d04ce1eaf -r ee06d8b5712f tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py Tue Mar 20 17:30:05 2007 +0000
+++ b/tools/python/xen/xm/main.py Tue Mar 20 17:30:52 2007 +0000
@@ -1544,8 +1544,11 @@ def xm_trigger(args):
trigger = args[1]
if len(args) == 3:
vcpu = int(args[2])
-
- server.xend.domain.send_trigger(dom, trigger, vcpu)
+
+ if serverType == SERVER_XEN_API:
+ server.xenapi.VM.send_trigger(get_single_vm(dom), trigger, vcpu)
+ else:
+ server.xend.domain.send_trigger(dom, trigger, vcpu)
def xm_debug_keys(args):
arg_check(args, "debug-keys", 1)
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|