Bug 490572
Summary: | three methods having the same name createXML() in the libvirt.py | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Gunannan Ren <gren> | ||||
Component: | libvirt | Assignee: | Daniel Veillard <veillard> | ||||
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 5.4 | CC: | apevec, berrange, crobinso, dallan, llim, nzhang, tyan, virt-maint, xen-maint | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2009-09-02 09:22:23 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Gunannan Ren
2009-03-17 02:36:53 UTC
Confirmed :-( def createXML(self, xmlDesc, flags): """Create a new storage based on its XML description. The pool is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted """ ret = libvirtmod.virStoragePoolCreateXML(self._o, xmlDesc, flags) if ret is None:raise libvirtError('virStoragePoolCreateXML() failed', conn=self) __tmp = virStoragePool(self, _obj=ret) return __tmp def createXML(self, xmlDesc): """Create and start a new virtual network, based on an XML description similar to the one returned by virNetworkGetXMLDesc() """ ret = libvirtmod.virNetworkCreateXML(self._o, xmlDesc) if ret is None:raise libvirtError('virNetworkCreateXML() failed', conn=self) __tmp = virNetwork(self, _obj=ret) return __tmp def createXML(self, xmlDesc, flags): """Launch a new guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc() This function may requires privileged access to the hypervisor. The domain is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted (see virDomainDefineXML() to define persistent domains). """ ret = libvirtmod.virDomainCreateXML(self._o, xmlDesc, flags) if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self) __tmp = virDomain(self,_obj=ret) return __tmp It is also generating bogus public APis for an internal method def ref(self): """Increment the reference count on the connection. For each additional call to this method, there shall be a corresponding call to virConnectClose to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a connection would increment the reference count. """ ret = libvirtmod.virConnectRef(self._o) if ret == -1: raise libvirtError ('virConnectRef() failed', conn=self) return ret And several other 'ref' methods later I suggest to rename createXML,like this: createXML-->CreateStoragePoolXML :virStoragePoolCreateXML createXML-->CreateNetworkXML :virNetworkCreateXML createXML-->CreateDomainXML :virDomainCreateXML Moving to RHEL since libvirt is not supported in RHEV1.0 production builds and this problem will need to be addressed in RHEL5.4 release Created attachment 337290 [details]
Fix python generator
That patch was actually included as part of the 0.6.3 rebase, so the fix is in the current build, Daniel Checking with "/usr/lib64/python2.4/site-packages/libvirt.py", the following function was renamed with the different name, and fixed this problem. def createXML(self, xmlDesc, flags): """Launch a new guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc() This function may requires privileged access to the hypervisor. The domain is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted (see virDomainDefineXML() to define persistent domains). """ ret = libvirtmod.virDomainCreateXML(self._o, xmlDesc, flags) if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self) __tmp = virDomain(self,_obj=ret) return __tmp def networkCreateXML(self, xmlDesc): """Create and start a new virtual network, based on an XML description similar to the one returned by virNetworkGetXMLDesc() """ ret = libvirtmod.virNetworkCreateXML(self._o, xmlDesc) if ret is None:raise libvirtError('virNetworkCreateXML() failed', conn=self) __tmp = virNetwork(self, _obj=ret) return __tmp def storagePoolCreateXML(self, xmlDesc, flags): """Create a new storage based on its XML description. The pool is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted """ ret = libvirtmod.virStoragePoolCreateXML(self._o, xmlDesc, flags) if ret is None:raise libvirtError('virStoragePoolCreateXML() failed', conn=self) __tmp = virStoragePool(self, _obj=ret) return __tmp This bug has been verified with libvirt 0.6.3-6 on RHEL-5.4. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2009-1269.html |