From patchwork Thu May 12 14:10:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9081791 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EEC309F372 for ; Thu, 12 May 2016 14:14:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D8FE201EC for ; Thu, 12 May 2016 14:14:29 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id A393F201E4 for ; Thu, 12 May 2016 14:14:28 +0000 (UTC) Received: from localhost ([::1]:57696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0rNj-0003AA-8B for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 May 2016 10:14:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0rJt-0006WT-TW for qemu-devel@nongnu.org; Thu, 12 May 2016 10:10:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0rJj-0005or-Rx for qemu-devel@nongnu.org; Thu, 12 May 2016 10:10:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0rJj-0005oT-0d for qemu-devel@nongnu.org; Thu, 12 May 2016 10:10:19 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 A84EF63333 for ; Thu, 12 May 2016 14:10:18 +0000 (UTC) Received: from localhost (vpn1-6-225.gru2.redhat.com [10.97.6.225]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4CEAHJ9014947; Thu, 12 May 2016 10:10:18 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org, Paolo Bonzini Date: Thu, 12 May 2016 11:10:03 -0300 Message-Id: <1463062204-20330-6-git-send-email-ehabkost@redhat.com> In-Reply-To: <1463062204-20330-1-git-send-email-ehabkost@redhat.com> References: <1463062204-20330-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 12 May 2016 14:10:18 +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] [PATCH 5/6] main-loop: Make qemu_init_main_loop() and qemu_signal_init() void 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: Markus Armbruster Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Their return values are not used by their callers anymore, so the functions can be void. Signed-off-by: Eduardo Habkost --- include/qemu/main-loop.h | 2 +- main-loop.c | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h index 19b5de3..572cf8e 100644 --- a/include/qemu/main-loop.h +++ b/include/qemu/main-loop.h @@ -42,7 +42,7 @@ * * In the case of QEMU tools, this will also start/initialize timers. */ -int qemu_init_main_loop(Error **errp); +void qemu_init_main_loop(Error **errp); /** * main_loop_wait: Run one iteration of the main loop. diff --git a/main-loop.c b/main-loop.c index 8e8eafc..90685ee 100644 --- a/main-loop.c +++ b/main-loop.c @@ -71,7 +71,7 @@ static void sigfd_handler(void *opaque) } } -static int qemu_signal_init(Error **errp) +static void qemu_signal_init(Error **errp) { int sigfd; sigset_t set; @@ -97,21 +97,18 @@ static int qemu_signal_init(Error **errp) sigfd = qemu_signalfd(&set); if (sigfd == -1) { error_setg_errno(errp, errno, "failed to create signalfd"); - return -errno; + return; } fcntl_setfl(sigfd, O_NONBLOCK); qemu_set_fd_handler(sigfd, sigfd_handler, NULL, (void *)(intptr_t)sigfd); - - return 0; } #else /* _WIN32 */ -static int qemu_signal_init(Error **errp) +static void qemu_signal_init(Error **errp) { - return 0; } #endif @@ -140,25 +137,24 @@ void qemu_notify_event(void) static GArray *gpollfds; -int qemu_init_main_loop(Error **errp) +void qemu_init_main_loop(Error **errp) { - int ret; GSource *src; Error *local_error = NULL; init_clocks(); - ret = qemu_signal_init(&local_error); - if (ret) { + qemu_signal_init(&local_error); + if (local_error) { error_propagate(errp, local_error); - return ret; + return; } qemu_aio_context = aio_context_new(&local_error); qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL); if (!qemu_aio_context) { error_propagate(errp, local_error); - return -EMFILE; + return; } gpollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD)); src = aio_get_g_source(qemu_aio_context); @@ -167,7 +163,6 @@ int qemu_init_main_loop(Error **errp) src = iohandler_get_g_source(); g_source_attach(src, NULL); g_source_unref(src); - return 0; } static int max_priority;