summaryrefslogtreecommitdiffstats
path: root/aio-posix.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2015-10-23 11:08:05 +0800
committerKevin Wolf <kwolf@redhat.com>2015-10-23 18:18:23 +0200
commitdca21ef23ba48f6f1428c59f295a857e5dc203c8 (patch)
tree28daeefd49eb4e968495c755f1af3855486e3e61 /aio-posix.c
parentd87d01e16a0e59a6af9634162cf0ded142b43e0d (diff)
downloadhqemu-dca21ef23ba48f6f1428c59f295a857e5dc203c8.zip
hqemu-dca21ef23ba48f6f1428c59f295a857e5dc203c8.tar.gz
aio: Add "is_external" flag for event handlers
All callers pass in false, and the real external ones will switch to true in coming patches. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'aio-posix.c')
-rw-r--r--aio-posix.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/aio-posix.c b/aio-posix.c
index d477033..f0f9122 100644
--- a/aio-posix.c
+++ b/aio-posix.c
@@ -25,6 +25,7 @@ struct AioHandler
IOHandler *io_write;
int deleted;
void *opaque;
+ bool is_external;
QLIST_ENTRY(AioHandler) node;
};
@@ -43,6 +44,7 @@ static AioHandler *find_aio_handler(AioContext *ctx, int fd)
void aio_set_fd_handler(AioContext *ctx,
int fd,
+ bool is_external,
IOHandler *io_read,
IOHandler *io_write,
void *opaque)
@@ -82,6 +84,7 @@ void aio_set_fd_handler(AioContext *ctx,
node->io_read = io_read;
node->io_write = io_write;
node->opaque = opaque;
+ node->is_external = is_external;
node->pfd.events = (io_read ? G_IO_IN | G_IO_HUP | G_IO_ERR : 0);
node->pfd.events |= (io_write ? G_IO_OUT | G_IO_ERR : 0);
@@ -92,10 +95,11 @@ void aio_set_fd_handler(AioContext *ctx,
void aio_set_event_notifier(AioContext *ctx,
EventNotifier *notifier,
+ bool is_external,
EventNotifierHandler *io_read)
{
aio_set_fd_handler(ctx, event_notifier_get_fd(notifier),
- (IOHandler *)io_read, NULL, notifier);
+ is_external, (IOHandler *)io_read, NULL, notifier);
}
bool aio_prepare(AioContext *ctx)
OpenPOWER on IntegriCloud