On 12/13/2011 05:38 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berra...@redhat.com>
> 
> 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   ebl...@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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to