[libvirt] [libvirt-java] [PATCH 36/65] jna: Wrap the virEvent(Add, Remove)Timeout libvirt functions

Eric Blake eblake at redhat.com
Mon Mar 3 20:05:01 UTC 2014


On 03/03/2014 08:58 AM, Daniel P. Berrange wrote:
> On Mon, Mar 03, 2014 at 04:46:51PM +0100, Claudio Bley wrote:
>> At Fri, 21 Feb 2014 11:01:47 +0000,
>> Daniel P. Berrange wrote:
>>>
>>> ACK, if you also add the virEventUpdateTimeout  method
>>
>> OK, but why should I add it? It's useless (for the user) and unused by
>> the wrapping code. I want to keep the JNA library definition clean --
>> e.g. in a later patch I remove all the *UUIDString functions.
> 
> What makes you say it is useless ?   The UpdateTimeout method lets you
> alter the timeout value for an existing timer, without having to go
> through Remove+Add of it. This might seem like a subtle distinction,
> but the difference is that the UpdateTimeout is guaranteed not to
> fail, where as Remove+Add may fail.

In fact, in my recent 'virsh event' additions, I explicitly used code
that adds a timer with a -1 initial period (never fires), then use
Update to turn it on and back off for each use of the 'event' command,
rather than having to worry about Add failing on a per-command basis.
The event loop code really does want all three callbacks to exist.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140303/e5409a67/attachment-0001.sig>


More information about the libvir-list mailing list