[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libvir] [PATCH] Python bindings: Use virDomain/NetworkGetConnect instead of storing connection in domain/network object



On Mon, Jul 23, 2007 at 04:00:59PM +0100, Richard W.M. Jones wrote:
> Previously[1] I patched libvirt to add the virDomainGetConnect and 
> virNetworkGetConnect functions.  The rationale for these is explained 
> here[2].
> 
> The attached patch makes the Python bindings use these functions instead 
> of storing the connection object explicitly.

  Hum ... The problem was the following:

    - you create a connection
    - you get a domain pointer from the connection
    - you delete the reference from the connection (e.g. by exiting
      the method) but keep the domain object
    - the connection count of the python object goes down to 0
    - _del() is called on the object
    - the connection is closed at the C level
    - you have a dandling domain python object whose C pointer is dead

Are you sure your patch is safe ?

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]