[libvirt] Raising events for testing

arnaud.champion at devatom.fr arnaud.champion at devatom.fr
Fri Jan 28 15:53:03 UTC 2011


Woohoo it will burn my brain :)

--------------------------------------------------
From: "Daniel P. Berrange" <berrange at redhat.com>
Sent: Friday, January 28, 2011 4:24 PM
To: <arnaud.champion at devatom.fr>
Cc: <libvir-list at redhat.com>
Subject: Re: [libvirt] Raising events for testing

> On Fri, Jan 28, 2011 at 04:17:21PM +0100, arnaud.champion at devatom.fr 
> wrote:
>> I suffer with the new callback API :)
>>
>> Does the new callback API need the EventRegisterImpl call ?
>
> Yes, virEventRegisterImpl is required in order to be able to
> receive events.
>
>> Can anyone explain me the steps to install these callbacks ? I have
>> a lot of difficulties to understand the polling process in the
>> sample, does this polling is mandatory ?
>
> Events can arrive at the client socket from libvirtd at
> any time. The poll() is used to watch for events arriving
> and ensure immediate dispatch. If we didn't do this no
> events would be seen until the next API call was made
> which is sub-optimal.
>
> The file daemon/events.c shows a complete C implementation
> of the event callbacks.
>
> The file examples/domain-events/events-python/domain-events.py
> shows a pure Python implementation
>
> The C example program is a very *bad* demo of poll() so ignore
> that and look at daemon/events.c instead.
>
> Daniel
> 




More information about the libvir-list mailing list