mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
5e1b34a3fa
commit
7e00346505
|
@ -485,12 +485,13 @@ bool aio_poll(AioContext *ctx, bool blocking)
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
void aio_context_setup(AioContext *ctx, Error **errp)
|
void aio_context_setup(AioContext *ctx)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_EPOLL_CREATE1
|
#ifdef CONFIG_EPOLL_CREATE1
|
||||||
assert(!ctx->epollfd);
|
assert(!ctx->epollfd);
|
||||||
ctx->epollfd = epoll_create1(EPOLL_CLOEXEC);
|
ctx->epollfd = epoll_create1(EPOLL_CLOEXEC);
|
||||||
if (ctx->epollfd == -1) {
|
if (ctx->epollfd == -1) {
|
||||||
|
fprintf(stderr, "Failed to create epoll instance: %s", strerror(errno));
|
||||||
ctx->epoll_available = false;
|
ctx->epoll_available = false;
|
||||||
} else {
|
} else {
|
||||||
ctx->epoll_available = true;
|
ctx->epoll_available = true;
|
||||||
|
|
|
@ -371,6 +371,6 @@ bool aio_poll(AioContext *ctx, bool blocking)
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
void aio_context_setup(AioContext *ctx, Error **errp)
|
void aio_context_setup(AioContext *ctx)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
8
async.c
8
async.c
|
@ -347,14 +347,10 @@ AioContext *aio_context_new(Error **errp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
AioContext *ctx;
|
AioContext *ctx;
|
||||||
Error *local_err = NULL;
|
|
||||||
|
|
||||||
ctx = (AioContext *) g_source_new(&aio_source_funcs, sizeof(AioContext));
|
ctx = (AioContext *) g_source_new(&aio_source_funcs, sizeof(AioContext));
|
||||||
aio_context_setup(ctx, &local_err);
|
aio_context_setup(ctx);
|
||||||
if (local_err) {
|
|
||||||
error_propagate(errp, local_err);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
ret = event_notifier_init(&ctx->notifier, false);
|
ret = event_notifier_init(&ctx->notifier, false);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error_setg_errno(errp, -ret, "Failed to initialize event notifier");
|
error_setg_errno(errp, -ret, "Failed to initialize event notifier");
|
||||||
|
|
|
@ -452,6 +452,6 @@ static inline bool aio_node_check(AioContext *ctx, bool is_external)
|
||||||
*
|
*
|
||||||
* Initialize the aio context.
|
* Initialize the aio context.
|
||||||
*/
|
*/
|
||||||
void aio_context_setup(AioContext *ctx, Error **errp);
|
void aio_context_setup(AioContext *ctx);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue