From patchwork Fri Jul 15 10:28:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cao jin X-Patchwork-Id: 648756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rrTCq3T6Jz9s9N for ; Fri, 15 Jul 2016 20:22:47 +1000 (AEST) Received: from localhost ([::1]:59690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO0Gb-0000uA-FL for incoming@patchwork.ozlabs.org; Fri, 15 Jul 2016 06:22:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO0Ft-0000WT-FZ for qemu-devel@nongnu.org; Fri, 15 Jul 2016 06:22:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO0Fr-0003tx-FN for qemu-devel@nongnu.org; Fri, 15 Jul 2016 06:22:00 -0400 Received: from [59.151.112.132] (port=26229 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO0Fk-0003sZ-3v; Fri, 15 Jul 2016 06:21:52 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="8751011" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 15 Jul 2016 18:21:44 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id F1F6942B87DC; Fri, 15 Jul 2016 18:21:45 +0800 (CST) Received: from G08FNSTD140223.g08.fujitsu.local (10.167.226.69) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.279.2; Fri, 15 Jul 2016 18:21:44 +0800 From: Cao jin To: Date: Fri, 15 Jul 2016 18:28:44 +0800 Message-ID: <1468578524-23433-1-git-send-email-caoj.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.69] X-yoursite-MailScanner-ID: F1F6942B87DC.ADA8B X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: caoj.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Subject: [Qemu-devel] [PATCH v4] 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: Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- aio-posix.c | 3 ++- aio-win32.c | 2 +- async.c | 8 ++------ include/block/aio.h | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) v4 changelog: 1. replace plain errno with strerror(errno) (Eric) 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 fb7dd92..8589017 100644 --- a/async.c +++ b/async.c @@ -327,14 +327,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 88a64ee..0922b69 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -439,6 +439,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