Re: [PATCH 8/8] Only add the timer when a callback is registered

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

 



On 12/13/2011 05:38 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> The lifetime of the virDomainEventState object is tied to
> the lifetime of the driver, which in stateless drivers is
> tied to the lifetime of the virConnectPtr.
> 
> If we add & remove a timer when allocating/freeing the
> virDomainEventState object, we can get a situation where
> the timer still triggers once after virDomainEventState
> has been freed. The timeout callback can't keep a ref
> on the event state though, since that would be a circular
> reference.
> 
> The trick is to only register the timer when a callback
> is registered with the event state & remove the timer
> when the callback is unregistered.

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +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]