From patchwork Mon Jul 18 16:59:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 9234919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C98516075D for ; Mon, 18 Jul 2016 17:06:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B670E1FF29 for ; Mon, 18 Jul 2016 17:06:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB54C200DF; Mon, 18 Jul 2016 17:06:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 35C6F1FF29 for ; Mon, 18 Jul 2016 17:06:13 +0000 (UTC) Received: from localhost ([::1]:49059 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPBzg-00050V-BR for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Jul 2016 13:06:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPBtN-0005OF-7r for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:59:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPBtI-0004PR-KE for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:59:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPBtI-0004PG-Dh for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:59:36 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E63A981F03; Mon, 18 Jul 2016 16:59:35 +0000 (UTC) Received: from localhost (ovpn-112-62.ams2.redhat.com [10.36.112.62]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6IGxYFe014201; Mon, 18 Jul 2016 12:59:35 -0400 From: Stefan Hajnoczi To: Date: Mon, 18 Jul 2016 17:59:18 +0100 Message-Id: <1468861161-21984-6-git-send-email-stefanha@redhat.com> In-Reply-To: <1468861161-21984-1-git-send-email-stefanha@redhat.com> References: <1468861161-21984-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 18 Jul 2016 16:59:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/8] aio-posix: remove useless parameter X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cao jin , Fam Zheng , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Cao jin Parameter **errp of aio_context_setup() is useless, remove it and clean up the related code. Cc: Stefan Hajnoczi Cc: Fam Zheng Cc: Eric Blake Signed-off-by: Cao jin Reviewed-by: Eric Blake Message-id: 1468578524-23433-1-git-send-email-caoj.fnst@cn.fujitsu.com Signed-off-by: Stefan Hajnoczi --- aio-posix.c | 3 ++- aio-win32.c | 2 +- async.c | 8 ++------ include/block/aio.h | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index 6006122..43162a9 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 6aaa32a..c8c249e 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 0e0efc3..3bca9b0 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 afd72a7..209551d 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