From patchwork Thu May 12 14:10:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9081751 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4E2BEBF29F for ; Thu, 12 May 2016 14:13:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA187201F4 for ; Thu, 12 May 2016 14:13:00 +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 164F5201E4 for ; Thu, 12 May 2016 14:13:00 +0000 (UTC) Received: from localhost ([::1]:57685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0rMJ-0000ns-60 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 May 2016 10:12:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0rJl-0006Mf-WD for qemu-devel@nongnu.org; Thu, 12 May 2016 10:10:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0rJj-0005oo-S4 for qemu-devel@nongnu.org; Thu, 12 May 2016 10:10:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0rJf-0005oB-KF for qemu-devel@nongnu.org; Thu, 12 May 2016 10:10:19 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 39EA18E3DA for ; Thu, 12 May 2016 14:10:15 +0000 (UTC) Received: from localhost (vpn1-6-225.gru2.redhat.com [10.97.6.225]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4CEAE8s020829; Thu, 12 May 2016 10:10:14 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org, Paolo Bonzini Date: Thu, 12 May 2016 11:10:01 -0300 Message-Id: <1463062204-20330-4-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.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 12 May 2016 14:10:15 +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 3/6] main-loop: Use Error** to report qemu_signal_init() errors 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 Signed-off-by: Eduardo Habkost --- main-loop.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main-loop.c b/main-loop.c index 89a6994..8e8eafc 100644 --- a/main-loop.c +++ b/main-loop.c @@ -71,7 +71,7 @@ static void sigfd_handler(void *opaque) } } -static int qemu_signal_init(void) +static int qemu_signal_init(Error **errp) { int sigfd; sigset_t set; @@ -96,7 +96,7 @@ static int qemu_signal_init(void) sigdelset(&set, SIG_IPI); sigfd = qemu_signalfd(&set); if (sigfd == -1) { - fprintf(stderr, "failed to create signalfd\n"); + error_setg_errno(errp, errno, "failed to create signalfd"); return -errno; } @@ -109,7 +109,7 @@ static int qemu_signal_init(void) #else /* _WIN32 */ -static int qemu_signal_init(void) +static int qemu_signal_init(Error **errp) { return 0; } @@ -148,8 +148,9 @@ int qemu_init_main_loop(Error **errp) init_clocks(); - ret = qemu_signal_init(); + ret = qemu_signal_init(&local_error); if (ret) { + error_propagate(errp, local_error); return ret; }