Re: [PATCHv3 3/6] virsh: Unregister the connection close notifier upon termination

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

 



On 03/31/2013 10:20 AM, Peter Krempa wrote:
> From: Viktor Mihajlovski <mihajlov@xxxxxxxxxxxxxxxxxx>
> 
> Before closing the connection we unregister the close callback
> to prevent a reference leak.
> 
> Further, the messages on virConnectClose != 0 are a bit more specific
> now.
> 
> Signed-off-by: Viktor Mihajlovski <mihajlov@xxxxxxxxxxxxxxxxxx>
> ---
>  tools/virsh.c | 23 ++++++++++++++++++-----
>  1 file changed, 18 insertions(+), 5 deletions(-)

ACK.

Thanks to patch 2/6, you could now technically close the connection
first, then unregister the callback, and the reference held by the
callback will ensure that the connection lives long enough to let that
work even after things were "closed".  Most likely to happen if things
are multithreaded, where one thread is unregistering while another
thread is closing the connection.  But given that earlier libvirt had
problems, we obviously don't want to advertise that "backwards" approach
to cleanup.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]