ia64/xen-unstable

changeset 16686:40f9dda7c5f5

[Xend] Fix 2 problems related to SR class

This fixes two problems related to the SR class:
- get_PBDs() was not implemented
- get_physical_size did not work

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 08 09:54:06 2008 +0000 (2008-01-08)
parents 9d22f78d9e5a
children 25771a7c2907
files tools/python/xen/xend/XendAPI.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Tue Jan 08 09:45:58 2008 +0000
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Tue Jan 08 09:54:06 2008 +0000
     1.3 @@ -2475,6 +2475,7 @@ class XendAPI(object):
     1.4      # Xen API: Class SR
     1.5      # ----------------------------------------------------------------
     1.6      SR_attr_ro = ['VDIs',
     1.7 +                  'PBDs',
     1.8                    'virtual_allocation',
     1.9                    'physical_utilisation',
    1.10                    'physical_size',
    1.11 @@ -2524,6 +2525,9 @@ class XendAPI(object):
    1.12      def SR_get_VDIs(self, _, ref):
    1.13          return self._get_SR_func(ref, 'list_images')
    1.14  
    1.15 +    def SR_get_PBDs(self, _, ref):
    1.16 +        return xen_api_success(XendPBD.get_by_SR(ref))
    1.17 +
    1.18      def SR_get_virtual_allocation(self, _, ref):
    1.19          return self._get_SR_func(ref, 'virtual_allocation')
    1.20  
    1.21 @@ -2531,7 +2535,7 @@ class XendAPI(object):
    1.22          return self._get_SR_func(ref, 'physical_utilisation')
    1.23  
    1.24      def SR_get_physical_size(self, _, ref):
    1.25 -        return self._get_SR_func(ref, 'physical_size')
    1.26 +        return self._get_SR_attr(ref, 'physical_size')
    1.27      
    1.28      def SR_get_type(self, _, ref):
    1.29          return self._get_SR_attr(ref, 'type')