ia64/xen-unstable

changeset 15170:e1f43038f1d8

Add some fields from XenAPI docs to implementation.
Add stefan's patch to swap mtu and mac, so they're correct.

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author Tom Wilkie <tom.wilkie@gmail.com>
date Tue May 15 17:01:57 2007 +0100 (2007-05-15)
parents d4a0706d6747
children 5c7a1e3abd54
files tools/python/xen/xend/XendAPI.py tools/python/xen/xend/XendNode.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Tue May 15 15:14:02 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Tue May 15 17:01:57 2007 +0100
     1.3 @@ -882,7 +882,8 @@ class XendAPI(object):
     1.4      
     1.5      host_attr_rw = ['name_label',
     1.6                      'name_description',
     1.7 -                    'other_config']
     1.8 +                    'other_config',
     1.9 +                    'logging']
    1.10  
    1.11      host_methods = [('disable', None),
    1.12                      ('enable', None),
    1.13 @@ -957,7 +958,11 @@ class XendAPI(object):
    1.14          return xen_api_success(XendNode.instance().get_vcpus_policy())
    1.15      def host_get_cpu_configuration(self, _, host_ref):
    1.16          return xen_api_success(XendNode.instance().get_cpu_configuration())
    1.17 -    
    1.18 +    def host_set_logging(self, _, host_ref, logging):
    1.19 +        return xen_api_todo()
    1.20 +    def host_get_logging(self, _, host_ref):
    1.21 +        return xen_api_todo()
    1.22 +
    1.23      # object methods
    1.24      def host_disable(self, session, host_ref):
    1.25          XendDomain.instance().set_allow_new_domains(False)
    1.26 @@ -1010,7 +1015,10 @@ class XendAPI(object):
    1.27                    'metrics': node.host_metrics_uuid,
    1.28                    'capabilities': node.get_capabilities(),
    1.29                    'supported_bootloaders': ['pygrub'],
    1.30 -                  'sched_policy': node.get_vcpus_policy()}
    1.31 +                  'sched_policy': node.get_vcpus_policy(),
    1.32 +                  'logging': {},
    1.33 +                  'PIFs': XendPIF.get_all(),
    1.34 +                  'PBDs': XendPBD.get_all()}
    1.35          return xen_api_success(record)
    1.36  
    1.37      # class methods
    1.38 @@ -1133,7 +1141,8 @@ class XendAPI(object):
    1.39                    'tools_version',
    1.40                    'domid',
    1.41                    'is_control_domain',
    1.42 -                  'metrics'
    1.43 +                  'metrics',
    1.44 +                  'crash_dumps',
    1.45                    ]
    1.46                    
    1.47      VM_attr_rw = ['name_label',
    1.48 @@ -1572,6 +1581,9 @@ class XendAPI(object):
    1.49          else:
    1.50              return xen_api_success_void()
    1.51  
    1.52 +    def VM_get_crash_dumps(self, _, vm_ref):
    1.53 +        return xen_api_todo()
    1.54 +
    1.55      # class methods
    1.56      def VM_get_all(self, session):
    1.57          refs = [d.get_uuid() for d in XendDomain.instance().list('all')]
    1.58 @@ -1636,7 +1648,8 @@ class XendAPI(object):
    1.59              'other_config': xeninfo.info.get('other_config', {}),
    1.60              'domid': domid is None and -1 or domid,
    1.61              'is_control_domain': xeninfo.info['is_control_domain'],
    1.62 -            'metrics': xeninfo.get_metrics()
    1.63 +            'metrics': xeninfo.get_metrics(),
    1.64 +            'crash_dumps': []
    1.65          }
    1.66          return xen_api_success(record)
    1.67  
     2.1 --- a/tools/python/xen/xend/XendNode.py	Tue May 15 15:14:02 2007 +0100
     2.2 +++ b/tools/python/xen/xend/XendNode.py	Tue May 15 17:01:57 2007 +0100
     2.3 @@ -195,7 +195,7 @@ class XendNode:
     2.4                          network_uuid, 'network')
     2.5                      if network.get_name_label() == bridge_name:
     2.6                          XendPIF.create_phy(network_uuid, name,
     2.7 -                                           mtu, mac)
     2.8 +                                           mac, mtu)
     2.9                          break
    2.10                  else:
    2.11                      log.debug("Cannot find network for bridge %s "
    2.12 @@ -233,8 +233,9 @@ class XendNode:
    2.13    ##      self.save_networks()
    2.14  
    2.15  
    2.16 -##    def get_PIF_refs(self):
    2.17 -##       return self.pifs[:]
    2.18 +    def get_PIF_refs(self):
    2.19 +        log.debug(XendPIF.get_all())
    2.20 +        return XendPIF.get_all()
    2.21  
    2.22  ##   def _PIF_create(self, name, mtu, vlan, mac, network, persist = True,
    2.23  ##                     pif_uuid = None, metrics_uuid = None):