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

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

 



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@xxxxxxxxxx  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]