Okay I have understand the use and mean of poll (pollfd... bla...bla...bla...) I have also discover that there is no Win32 equivalent which work with a file descriptor (unix way...). Win32 has a select method that can be used to emulate the poll function, but the fd_set structure is base on socket and not on a file descriptor. Does anyone know a way to have a select or poll function that works with file descriptor under windows ? (maybe via mingw, I don't know)

Regards,

Arnaud

--------------------------------------------------
From: <arnaud.champ...@devatom.fr>
Sent: Friday, January 28, 2011 7:06 PM
To: "Daniel P. Berrange" <berra...@redhat.com>
Cc: <libvir-list@redhat.com>
Subject: Re: [libvirt] Raising events for testing

Okay, I'm trying to understand the Python implentation (I'm not a python expert but it seems to be quite readable once you've understand why there is "self" everywhere :) ). The thing I'm not able to understand is the call to the "poll" function as this function doesn't exists in C# in any library at my knows... I'm not fluent with this. Anyone can expliain what poll do ?

Regards

Arnaud

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

Woohoo it will burn my brain :)

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

On Fri, Jan 28, 2011 at 04:17:21PM +0100, arnaud.champ...@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


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to