[libvirt] [PATCH 8/8] Only add the timer when a callback is registered
eblake at redhat.com
Wed Dec 14 22:18:41 UTC 2011
On 12/13/2011 05:38 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at 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
> 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.
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 620 bytes
Desc: OpenPGP digital signature
More information about the libvir-list