ia64/xen-unstable

changeset 14490:ee06d8b5712f

Make xm trigger talk XenAPI; add send_trigger to VM class.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Mar 20 17:30:52 2007 +0000 (2007-03-20)
parents 9f9d04ce1eaf
children 07d1bd92ade8
files tools/python/xen/xend/XendAPI.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Tue Mar 20 17:30:05 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Tue Mar 20 17:30:52 2007 +0000
     1.3 @@ -1087,7 +1087,8 @@ class XendAPI(object):
     1.4                    ('add_to_platform', None),
     1.5                    ('remove_from_platform', None),
     1.6                    ('add_to_other_config', None),
     1.7 -                  ('remove_from_other_config', None)]
     1.8 +                  ('remove_from_other_config', None),
     1.9 +                  ('send_trigger', None)]
    1.10      
    1.11      VM_funcs  = [('create', 'VM'),
    1.12                   ('get_by_name_label', 'Set(VM)')]
    1.13 @@ -1534,6 +1535,13 @@ class XendAPI(object):
    1.14          return xen_api_success_void()
    1.15  
    1.16  
    1.17 +    def VM_send_trigger(self, _, vm_ref, trigger, vcpu):
    1.18 +        xendom = XendDomain.instance()
    1.19 +        xeninfo = xendom.get_vm_by_uuid(vm_ref)
    1.20 +        xendom.domain_send_trigger(xeninfo.getDomid(), trigger, vcpu)
    1.21 +        return xen_api_success_void()
    1.22 +        
    1.23 +
    1.24      # Xen API: Class VM_metrics
    1.25      # ----------------------------------------------------------------
    1.26  
     2.1 --- a/tools/python/xen/xm/main.py	Tue Mar 20 17:30:05 2007 +0000
     2.2 +++ b/tools/python/xen/xm/main.py	Tue Mar 20 17:30:52 2007 +0000
     2.3 @@ -1544,8 +1544,11 @@ def xm_trigger(args):
     2.4      trigger = args[1]
     2.5      if len(args) == 3:
     2.6          vcpu = int(args[2])
     2.7 -    
     2.8 -    server.xend.domain.send_trigger(dom, trigger, vcpu)
     2.9 +        
    2.10 +    if serverType == SERVER_XEN_API:
    2.11 +        server.xenapi.VM.send_trigger(get_single_vm(dom), trigger, vcpu)
    2.12 +    else:
    2.13 +        server.xend.domain.send_trigger(dom, trigger, vcpu)
    2.14  
    2.15  def xm_debug_keys(args):
    2.16      arg_check(args, "debug-keys", 1)