From: Stefan Berger Subject: [PATCH] [Xen-API] Some fixes to the PBD class Date: Mon, 11 Feb 2008 07:54:13 -0500 Message-ID: <1202734453.23793.4.camel@gsal-3.watson.ibm.com> Reply-To: stefanb@us.ibm.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-fGfGCgyAGp1xrfD+GKZA" 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 Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org --=-fGfGCgyAGp1xrfD+GKZA Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch fixes some errors in Xen-API's PBD class. Signed-off-by: Stefan Berger < --=-fGfGCgyAGp1xrfD+GKZA Content-Disposition: attachment; filename=xen_api_pbd_fix.diff Content-Type: text/x-patch; name=xen_api_pbd_fix.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: root/xen-unstable.hg/tools/python/xen/xend/XendPBD.py =================================================================== --- root.orig/xen-unstable.hg/tools/python/xen/xend/XendPBD.py +++ root/xen-unstable.hg/tools/python/xen/xend/XendPBD.py @@ -20,6 +20,7 @@ import uuid from XendLogging import log from xen.xend.XendBase import XendBase from xen.xend import XendAPIStore +from xen.xend import uuid as genuuid class XendPBD(XendBase): """Physical block devices.""" @@ -39,8 +40,7 @@ class XendPBD(XendBase): return XendBase.getAttrRW() + attrRW def getAttrInst(self): - return ['uuid', - 'host', + return ['host', 'SR', 'device_config'] @@ -61,31 +61,31 @@ class XendPBD(XendBase): getFuncs = classmethod(getFuncs) def recreate(uuid, record): - pbd = XendPBD(uuid, record) + pbd = XendPBD(record, uuid) return uuid def create(cls, record): uuid = genuuid.createString() - pbd = XendPBD(uuid, record) - return uuid + pbd = XendPBD(record, uuid) + return uuid create = classmethod(create) - def __init__(self, uuid, record): + def __init__(self, record, uuid): XendBase.__init__(self, uuid, record) - this.currently_attached = True + self.currently_attached = True def get_host(self): - return this.host + return self.host def get_SR(self): - return this.SR + return self.SR def get_device_config(self): - return this.device_config + return self.device_config def get_currently_attached(self): - return this.currently_attached + return self.currently_attached def destroy(self): pass --=-fGfGCgyAGp1xrfD+GKZA 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 --=-fGfGCgyAGp1xrfD+GKZA--