summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCao jin <caoj.fnst@cn.fujitsu.com>2016-07-15 18:28:44 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2016-07-18 15:10:52 +0100
commit7e00346505feb94ee740d311621eb0bf4c14d6db (patch)
treec4612165af3f5fe678ac4454186c6fded1947ad2
parent5e1b34a3fa0a0fbf46628aab10cc49f6f855520e (diff)
downloadqemu-7e00346505feb94ee740d311621eb0bf4c14d6db.zip
aio-posix: remove useless parameter
Parameter **errp of aio_context_setup() is useless, remove it and clean up the related code. Cc: Stefan Hajnoczi <stefanha@redhat.com> Cc: Fam Zheng <famz@redhat.com> Cc: Eric Blake <eblake@redhat.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1468578524-23433-1-git-send-email-caoj.fnst@cn.fujitsu.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--aio-posix.c3
-rw-r--r--aio-win32.c2
-rw-r--r--async.c8
-rw-r--r--include/block/aio.h2
4 files changed, 6 insertions, 9 deletions
diff --git a/aio-posix.c b/aio-posix.c
index 6006122e0b..43162a9f29 100644
--- a/aio-posix.c
+++ b/aio-posix.c
@@ -485,12 +485,13 @@ bool aio_poll(AioContext *ctx, bool blocking)
return progress;
}
-void aio_context_setup(AioContext *ctx, Error **errp)
+void aio_context_setup(AioContext *ctx)
{
#ifdef CONFIG_EPOLL_CREATE1
assert(!ctx->epollfd);
ctx->epollfd = epoll_create1(EPOLL_CLOEXEC);
if (ctx->epollfd == -1) {
+ fprintf(stderr, "Failed to create epoll instance: %s", strerror(errno));
ctx->epoll_available = false;
} else {
ctx->epoll_available = true;
diff --git a/aio-win32.c b/aio-win32.c
index 6aaa32a147..c8c249e260 100644
--- a/aio-win32.c
+++ b/aio-win32.c
@@ -371,6 +371,6 @@ bool aio_poll(AioContext *ctx, bool blocking)
return progress;
}
-void aio_context_setup(AioContext *ctx, Error **errp)
+void aio_context_setup(AioContext *ctx)
{
}
diff --git a/async.c b/async.c
index 0e0efc340a..3bca9b0adb 100644
--- a/async.c
+++ b/async.c
@@ -347,14 +347,10 @@ AioContext *aio_context_new(Error **errp)
{
int ret;
AioContext *ctx;
- Error *local_err = NULL;
ctx = (AioContext *) g_source_new(&aio_source_funcs, sizeof(AioContext));
- aio_context_setup(ctx, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- goto fail;
- }
+ aio_context_setup(ctx);
+
ret = event_notifier_init(&ctx->notifier, false);
if (ret < 0) {
error_setg_errno(errp, -ret, "Failed to initialize event notifier");
diff --git a/include/block/aio.h b/include/block/aio.h
index afd72a7516..209551deb2 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -452,6 +452,6 @@ static inline bool aio_node_check(AioContext *ctx, bool is_external)
*
* Initialize the aio context.
*/
-void aio_context_setup(AioContext *ctx, Error **errp);
+void aio_context_setup(AioContext *ctx);
#endif