From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57071 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdNiI-0004RZ-A0 for qemu-devel@nongnu.org; Thu, 13 Jan 2011 08:59:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdNiH-0007vz-93 for qemu-devel@nongnu.org; Thu, 13 Jan 2011 08:59:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdNiH-0007vt-0y for qemu-devel@nongnu.org; Thu, 13 Jan 2011 08:59:41 -0500 Message-ID: <4D2F053E.8030008@redhat.com> Date: Thu, 13 Jan 2011 14:59:26 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <62faeb8db4ea4f9dc0dd7778e9643d13947714ff.1294923288.git.amit.shah@redhat.com> In-Reply-To: <62faeb8db4ea4f9dc0dd7778e9643d13947714ff.1294923288.git.amit.shah@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 2/5] iohandlers: Introduce assign_fd_handlers() and remove_fd_handlers List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu list , Paul Brook On 01/13/11 14:00, Amit Shah wrote: > This function will be used to assign fd handlers. Future commits will > be enable each handler to be enabled/disabled individually. > > Make qemu_set_fd_handler2() a wrapper to assign_fd_handlers(). > > remove_fd_handlers() removes all the assigned handlers and marks the > iohandler for deletion. It's a wrapper to assign_fd_handlers() with > NULL handlers. > > Signed-off-by: Amit Shah > --- > qemu-char.h | 6 ++++++ > vl.c | 24 +++++++++++++++++++----- > 2 files changed, 25 insertions(+), 5 deletions(-) > > diff --git a/qemu-char.h b/qemu-char.h > index e6ee6c4..0ef83f4 100644 > --- a/qemu-char.h > +++ b/qemu-char.h > @@ -109,6 +109,12 @@ size_t qemu_chr_mem_osize(const CharDriverState *chr); > > /* async I/O support */ > > +int assign_fd_handlers(int fd, > + IOCanReadHandler *fd_read_poll, > + IOHandler *fd_read, > + IOHandler *fd_write, > + void *opaque); > +void remove_fd_handlers(int fd); A comment documenting the new functions would be nice. cheers, Gerd