From patchwork Thu Aug 18 05:28:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 9286767 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 4C522607FF for ; Thu, 18 Aug 2016 05:29:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F60128D3F for ; Thu, 18 Aug 2016 05:29:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3414328D5D; Thu, 18 Aug 2016 05:29:01 +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 C946828D3F for ; Thu, 18 Aug 2016 05:29:00 +0000 (UTC) Received: from localhost ([::1]:50831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baFsx-0002uY-T0 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 18 Aug 2016 01:28:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baFsT-0002rB-Vk for qemu-devel@nongnu.org; Thu, 18 Aug 2016 01:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1baFsS-0008MG-3k for qemu-devel@nongnu.org; Thu, 18 Aug 2016 01:28:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baFsR-0008MB-UN for qemu-devel@nongnu.org; Thu, 18 Aug 2016 01:28:28 -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 8A8A37DD01; Thu, 18 Aug 2016 05:28:27 +0000 (UTC) Received: from pxdev.xzpeter.org (vpn1-5-7.pek2.redhat.com [10.72.5.7]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7I5SFpH004013; Thu, 18 Aug 2016 01:28:24 -0400 From: Peter Xu To: qemu-devel@nongnu.org Date: Thu, 18 Aug 2016 13:28:10 +0800 Message-Id: <1471498092-27135-3-git-send-email-peterx@redhat.com> In-Reply-To: <1471498092-27135-1-git-send-email-peterx@redhat.com> References: <1471498092-27135-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.26]); Thu, 18 Aug 2016 05:28:27 +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 v3 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 | 12 ++++++++++++ 2 files changed, 13 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 81379e1..d1c6b10 100644 --- a/util/qemu-error.c +++ b/util/qemu-error.c @@ -11,6 +11,7 @@ */ #include +#include #include "qemu/osdep.h" #include "monitor/monitor.h" #include "qemu/error-report.h" @@ -249,3 +250,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(); +}