From: Stefan Berger Subject: [PATCH] [Xend] Fix 2 problems related to SR class Date: Mon, 07 Jan 2008 07:04:46 -0500 Message-ID: <1199707486.12868.4.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-TgHC0AZ/Y4b90K+1RBPT" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: chetan.lists@gmail.com, keir@xensource.com List-Id: xen-devel@lists.xenproject.org --=-TgHC0AZ/Y4b90K+1RBPT Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-TgHC0AZ/Y4b90K+1RBPT Content-Disposition: attachment; filename=xend_fix_sr_class_issues.diff Content-Type: text/x-patch; name=xend_fix_sr_class_issues.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -r 2491691e3e69 tools/python/xen/xend/XendAPI.py --- a/tools/python/xen/xend/XendAPI.py Sat Dec 29 17:57:47 2007 +0000 +++ b/tools/python/xen/xend/XendAPI.py Mon Jan 07 06:58:18 2008 -0500 @@ -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') --=-TgHC0AZ/Y4b90K+1RBPT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-TgHC0AZ/Y4b90K+1RBPT--