aboutsummaryrefslogtreecommitdiff
path: root/posix-aio-compat.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2009-10-26 13:03:08 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-30 08:39:34 -0500
commit1e5b9d2fccb205ed8fc84fb38945b8fb3d225640 (patch)
treeccaa3ebeb0fc662822124cb29fd1559f789694a3 /posix-aio-compat.c
parentfa39472763229b335bd1f4b7c9ff8ec8455f98e5 (diff)
Remove aio_ctx from paio_* interface
The context parameter in paio_submit isn't used anyway, so there is no reason why block drivers should need to remember it. This also avoids passing a Linux AIO context to paio_submit (which doesn't do any harm as long as the parameter is unused, but it is highly confusing). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'posix-aio-compat.c')
-rw-r--r--posix-aio-compat.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index ec58288dc8..7f391c9373 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -556,7 +556,7 @@ static AIOPool raw_aio_pool = {
.cancel = paio_cancel,
};
-BlockDriverAIOCB *paio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
+BlockDriverAIOCB *paio_submit(BlockDriverState *bs, int fd,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque, int type)
{
@@ -607,7 +607,7 @@ BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd,
return &acb->common;
}
-void *paio_init(void)
+int paio_init(void)
{
struct sigaction act;
PosixAioState *s;
@@ -615,7 +615,7 @@ void *paio_init(void)
int ret;
if (posix_aio_state)
- return posix_aio_state;
+ return 0;
s = qemu_malloc(sizeof(PosixAioState));
@@ -627,7 +627,7 @@ void *paio_init(void)
s->first_aio = NULL;
if (pipe(fds) == -1) {
fprintf(stderr, "failed to create pipe\n");
- return NULL;
+ return -1;
}
s->rfd = fds[0];
@@ -650,6 +650,5 @@ void *paio_init(void)
QTAILQ_INIT(&request_list);
posix_aio_state = s;
-
- return posix_aio_state;
+ return 0;
}