qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, peter.maydell@linaro.org, pbonzini@redhat.com,
	famz@redhat.com, peterx@redhat.com
Subject: [Qemu-devel] [PATCH v3 2/4] error-report: provide error_report_abort()
Date: Thu, 18 Aug 2016 13:28:10 +0800	[thread overview]
Message-ID: <1471498092-27135-3-git-send-email-peterx@redhat.com> (raw)
In-Reply-To: <1471498092-27135-1-git-send-email-peterx@redhat.com>

A twin for error_report_fatal(), for programming errors.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 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 <unistd.h>
+#include <stdlib.h>
 #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();
+}
-- 
2.7.4

  parent reply	other threads:[~2016-08-18  5:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18  5:28 [Qemu-devel] [PATCH v3 0/4] Introduce error_report_{fatal|abort} Peter Xu
2016-08-18  5:28 ` [Qemu-devel] [PATCH v3 1/4] error-report: provide error_report_fatal() Peter Xu
2016-09-06  9:52   ` Fam Zheng
2016-08-18  5:28 ` Peter Xu [this message]
2016-09-06  9:53   ` [Qemu-devel] [PATCH v3 2/4] error-report: provide error_report_abort() Fam Zheng
2016-09-06 10:20     ` Peter Xu
2016-08-18  5:28 ` [Qemu-devel] [PATCH v3 3/4] error-report: leverage error_report_fatal() Peter Xu
2016-08-18  5:28 ` [Qemu-devel] [PATCH v3 4/4] error-report: leverage error_report_abort() Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471498092-27135-3-git-send-email-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=famz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).