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>
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index ec58288..7f391c9 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -556,7 +556,7 @@
     .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 @@
     return &acb->common;
 }
 
-void *paio_init(void)
+int paio_init(void)
 {
     struct sigaction act;
     PosixAioState *s;
@@ -615,7 +615,7 @@
     int ret;
 
     if (posix_aio_state)
-        return posix_aio_state;
+        return 0;
 
     s = qemu_malloc(sizeof(PosixAioState));
 
@@ -627,7 +627,7 @@
     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 @@
     QTAILQ_INIT(&request_list);
 
     posix_aio_state = s;
-
-    return posix_aio_state;
+    return 0;
 }