ia64/xen-unstable

changeset 19460:2269d8704139

XenAPI: Implement {get,set}_auto_power_on

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 31 11:48:07 2009 +0100 (2009-03-31)
parents cd6b3af19191
children ee3c5a08f80e
files tools/python/README.XendConfig tools/python/xen/xend/XendAPI.py tools/python/xen/xend/XendConfig.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/README.XendConfig	Tue Mar 31 11:47:20 2009 +0100
     1.2 +++ b/tools/python/README.XendConfig	Tue Mar 31 11:48:07 2009 +0100
     1.3 @@ -25,6 +25,7 @@ name_label                      name
     1.4  name_description
     1.5  user_version
     1.6  is_a_template
     1.7 +auto_power_on
     1.8  resident_on
     1.9  memory_static_min               memory
    1.10  memory_static_max               maxmem
     2.1 --- a/tools/python/xen/xend/XendAPI.py	Tue Mar 31 11:47:20 2009 +0100
     2.2 +++ b/tools/python/xen/xend/XendAPI.py	Tue Mar 31 11:48:07 2009 +0100
     2.3 @@ -1352,6 +1352,9 @@ class XendAPI(object):
     2.4      def VM_get_is_a_template(self, session, ref):
     2.5          return self.VM_get('is_a_template', session, ref)
     2.6      
     2.7 +    def VM_get_auto_power_on(self, session, vm_ref):
     2.8 +        return self.VM_get('auto_power_on', session, vm_ref)
     2.9 +    
    2.10      def VM_get_memory_dynamic_max(self, session, vm_ref):
    2.11          dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
    2.12          return xen_api_success(dom.get_memory_dynamic_max())
    2.13 @@ -1441,6 +1444,9 @@ class XendAPI(object):
    2.14          dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
    2.15          return xen_api_todo()
    2.16      
    2.17 +    def VM_set_auto_power_on(self, session, vm_ref, val):
    2.18 +        return self.VM_set('auto_power_on', session, vm_ref, val)
    2.19 +    
    2.20      def VM_set_memory_dynamic_max(self, session, vm_ref, mem):
    2.21          dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
    2.22          dom.set_memory_dynamic_max(int(mem))
    2.23 @@ -1682,7 +1688,7 @@ class XendAPI(object):
    2.24              'name_description': xeninfo.getName(),
    2.25              'user_version': 1,
    2.26              'is_a_template': xeninfo.info['is_a_template'],
    2.27 -            'auto_power_on': False,
    2.28 +            'auto_power_on': xeninfo.info['auto_power_on'],
    2.29              'resident_on': XendNode.instance().uuid,
    2.30              'memory_static_min': xeninfo.get_memory_static_min(),
    2.31              'memory_static_max': xeninfo.get_memory_static_max(),
     3.1 --- a/tools/python/xen/xend/XendConfig.py	Tue Mar 31 11:47:20 2009 +0100
     3.2 +++ b/tools/python/xen/xend/XendConfig.py	Tue Mar 31 11:48:07 2009 +0100
     3.3 @@ -187,6 +187,7 @@ XENAPI_CFG_TYPES = {
     3.4      'name_description': str,
     3.5      'user_version': str,
     3.6      'is_a_template': bool0,
     3.7 +    'auto_power_on': bool0,
     3.8      'resident_on': str,
     3.9      'memory_static_min': int,  # note these are stored in bytes, not KB!
    3.10      'memory_static_max': int,
    3.11 @@ -361,6 +362,7 @@ class XendConfig(dict):
    3.12              'actions_after_crash': 'restart',
    3.13              'actions_after_suspend': '',
    3.14              'is_a_template': False,
    3.15 +            'auto_power_on': False,
    3.16              'is_control_domain': False,
    3.17              'features': '',
    3.18              'PV_bootloader': '',
     4.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Mar 31 11:47:20 2009 +0100
     4.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Mar 31 11:48:07 2009 +0100
     4.3 @@ -144,6 +144,7 @@ def recreate(info, priv):
     4.4      xeninfo = XendConfig.XendConfig(dominfo = info)
     4.5      xeninfo['is_control_domain'] = priv
     4.6      xeninfo['is_a_template'] = False
     4.7 +    xeninfo['auto_power_on'] = False
     4.8      domid = xeninfo['domid']
     4.9      uuid1 = uuid.fromString(xeninfo['uuid'])
    4.10      needs_reinitialising = False