Skip to contentSkip to conversation

Fix 2 problems related to SR class

PATCH In review Stefan Berger 2 participants 2 messages Jan 7, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

tools/python/xen/xend/XendAPI.py +5 -1
diff -r 2491691e3e69 tools/python/xen/xend/XendAPI.py
@@ -2475,6 +2475,7 @@ class XendAPI(object):
     # Xen API: Class SR
     # ----------------------------------------------------------------
     SR_attr_ro = ['VDIs',
+                  'PBDs',
                   'virtual_allocation',
                   'physical_utilisation',
                   'physical_size',
@@ -2524,6 +2525,9 @@ class XendAPI(object):
     def SR_get_VDIs(self, _, ref):
         return self._get_SR_func(ref, 'list_images')
 
+    def SR_get_PBDs(self, _, ref):
+        return xen_api_success(XendPBD.get_by_SR(ref))
+
     def SR_get_virtual_allocation(self, _, ref):
         return self._get_SR_func(ref, 'virtual_allocation')
 
@@ -2531,7 +2535,7 @@ class XendAPI(object):
         return self._get_SR_func(ref, 'physical_utilisation')
 
     def SR_get_physical_size(self, _, ref):
-        return self._get_SR_func(ref, 'physical_size')
+        return self._get_SR_attr(ref, 'physical_size')
     
     def SR_get_type(self, _, ref):
         return self._get_SR_attr(ref, 'type')

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 7 lines · Stefan Berger

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

xen_vbd_get_status_detail() is also not implemented. Getting same error *MESSAGE_METHOD_UNKNOWN VBD.get_status_detail *