From patchwork Wed Sep 7 06:06:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 9318231 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 0D7BC6077F for ; Wed, 7 Sep 2016 06:08:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F24DB2902B for ; Wed, 7 Sep 2016 06:08:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E74D52902E; Wed, 7 Sep 2016 06:08:45 +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 9712B2902B for ; Wed, 7 Sep 2016 06:08:45 +0000 (UTC) Received: from localhost ([::1]:38213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhW2O-0001NF-N6 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 07 Sep 2016 02:08:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhW0Q-0008Ae-O2 for qemu-devel@nongnu.org; Wed, 07 Sep 2016 02:06:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhW0O-0001mg-Oh for qemu-devel@nongnu.org; Wed, 07 Sep 2016 02:06:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhW0O-0001mQ-KC for qemu-devel@nongnu.org; Wed, 07 Sep 2016 02:06:40 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 2DADFC01C774; Wed, 7 Sep 2016 06:06:40 +0000 (UTC) Received: from pxdev.xzpeter.org.com (dhcp-14-106.nay.redhat.com [10.66.14.106]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8766W2k024709; Wed, 7 Sep 2016 02:06:38 -0400 From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 7 Sep 2016 14:06:28 +0800 Message-Id: <1473228390-18669-3-git-send-email-peterx@redhat.com> In-Reply-To: <1473228390-18669-1-git-send-email-peterx@redhat.com> References: <1473228390-18669-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 07 Sep 2016 06:06:40 +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 v4 2/4] error-report: provide error_report_abort() 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@linaro.org, famz@redhat.com, armbru@redhat.com, peterx@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP A twin for error_report_fatal(), for programming errors. Signed-off-by: Peter Xu --- include/qemu/error-report.h | 1 + util/qemu-error.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h index eb8260e..51a6f31 100644 --- a/include/qemu/error-report.h +++ b/include/qemu/error-report.h @@ -37,6 +37,7 @@ void error_set_progname(const char *argv0); void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); void error_report_fatal(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void error_report_abort(const char *fmt, ...) GCC_FMT_ATTR(1, 2); const char *error_get_progname(void); extern bool enable_timestamp_msg; diff --git a/util/qemu-error.c b/util/qemu-error.c index 684f543..59726ab 100644 --- a/util/qemu-error.c +++ b/util/qemu-error.c @@ -248,3 +248,14 @@ void error_report_fatal(const char *fmt, ...) exit(1); } + +void error_report_abort(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + error_vreport(fmt, ap); + va_end(ap); + + abort(); +}