From: Avi Kivity <avi@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: qemu list <qemu-devel@nongnu.org>, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/7] iohandlers: Introduce a new API
Date: Tue, 22 Feb 2011 15:28:02 +0200 [thread overview]
Message-ID: <4D63B9E2.5060201@redhat.com> (raw)
In-Reply-To: <3d41a2ca603b8132e2496976e89fca09fc246683.1298369272.git.amit.shah@redhat.com>
On 02/22/2011 12:18 PM, Amit Shah wrote:
> Introduce a new iohandler api that doesn't have multiple callbacks.
> Instead, a single callback and a mask of events that got set will be
> passed on to the handler. This will ease our transition to a poll()
> interface instead of the current select() that happens on the fds.
>
>
> +
> +/* iohandler masks */
> +#define IOH_MASK_CAN_READ (1U<< 0)
> +#define IOH_MASK_READ (1U<< 1)
> +#define IOH_MASK_WRITE (1U<< 2)
> +
> +typedef int IOAllHandler(void *opaque, unsigned int mask);
Strange name.
Drop the opaque, instead put the IOHandler in there (or maybe the
CharDev?) and use container_of().
> +
> +int assign_iohandler(int fd, IOAllHandler *handler, unsigned int mask,
> + void *opaque);
> +int remove_iohandler(int fd);
> +int update_fd_mask(int fd, unsigned int mask);
> +int get_fd_mask(int fd, unsigned int *mask);
> +
iohandler_init(IOHandler *ioh, int fd, IOEventHandler *handler, unsigned
mask)
iohandler_del(IOHandler *ioh)
iohandler_set_event_mask(IOHandler *ioh, unsigned mask)
iohandler_event_mask(IOHandler *ioh)
No opaques, use an object as a key so you don't have to search for it.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-02-22 13:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 10:18 [Qemu-devel] [PATCH 0/7] New iohandler API Amit Shah
2011-02-22 10:18 ` [Qemu-devel] [PATCH 1/7] iohandlers: Mark current implementation as 'old' Amit Shah
2011-02-22 11:09 ` Avi Kivity
2011-02-22 11:17 ` Amit Shah
2011-02-22 13:28 ` Avi Kivity
2011-02-22 14:37 ` Amit Shah
2011-02-22 14:43 ` Avi Kivity
2011-02-22 10:18 ` [Qemu-devel] [PATCH 2/7] iohandlers: Introduce a new API Amit Shah
2011-02-22 12:39 ` Alon Levy
2011-02-22 13:09 ` Amit Shah
2011-02-22 13:28 ` Avi Kivity [this message]
2011-02-22 14:39 ` Amit Shah
2011-02-22 15:00 ` Anthony Liguori
2011-02-22 16:21 ` Avi Kivity
2011-02-22 18:21 ` Anthony Liguori
2011-02-23 12:40 ` Avi Kivity
2011-02-22 14:49 ` [Qemu-devel] " Anthony Liguori
2011-02-22 10:18 ` [Qemu-devel] [PATCH 3/7] char: tcp: Use new iohandler api Amit Shah
2011-02-22 10:18 ` [Qemu-devel] [PATCH 4/7] char: udp: " Amit Shah
2011-02-22 10:18 ` [Qemu-devel] [PATCH 5/7] char: fd: " Amit Shah
2011-02-22 10:18 ` [Qemu-devel] [PATCH 6/7] char: stdio: " Amit Shah
2011-02-22 10:18 ` [Qemu-devel] [PATCH 7/7] char: pty: " Amit Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D63B9E2.5060201@redhat.com \
--to=avi@redhat.com \
--cc=amit.shah@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.