Attached is a new version of the patch which allocs/frees memory for storing
the callback data in blocks. It also adds copious comments and fixes a very
subtle bug in adding handles during dispatch. The printfs are changed into
qemudDebug()s and the nvmfds field is killed here.
On Mon, Jun 18, 2007 at 05:49:59AM -0400, Daniel Veillard wrote:
On Sun, Jun 17, 2007 at 10:52:55PM +0100, Daniel P. Berrange wrote:
> The following patch adds a qemud/event.c & qemud/event.h file providing a
> general purpose event loop built around poll. Users register file handles
> and associated callbacks, and / or timers. The qemud.c file is changed to
> make use of these APIs for dealing with server, client, and VM file handles
> and/or sockets. This decouples much of the QEMU VM I/O code from the main
> qemud.c daemon code.
b/qemud/event.c | 460 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
b/qemud/event.h | 98 +++++++++++
qemud/Makefile.am | 3
qemud/internal.h | 1
qemud/qemud.c | 400 +++++++++++++++++++++++++---------------------
5 files changed, 774 insertions(+), 188 deletions(-)
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules:
http://search.cpan.org/~danberr/ -=|
|=- Projects:
http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|