From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Deepak C Shetty <deepakcs@linux.vnet.ibm.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] stubs: add error_report()
Date: Wed, 21 Aug 2013 14:26:40 +0200 [thread overview]
Message-ID: <1377088001-8783-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1377088001-8783-1-git-send-email-stefanha@redhat.com>
The error report function is preferred over fprintf(stderr, ...) since
it prints to the current monitor, if any.
Add a stub error_report() implementation that just prints to stderr.
This is suitable in environments where there is no QEMU monitor, such as
libcacard.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
stubs/Makefile.objs | 1 +
stubs/error-report.c | 12 ++++++++++++
2 files changed, 13 insertions(+)
create mode 100644 stubs/error-report.c
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index f306cba..f84d597 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -3,6 +3,7 @@ stub-obj-y += clock-warp.o
stub-obj-y += cpu-get-clock.o
stub-obj-y += cpu-get-icount.o
stub-obj-y += dump.o
+stub-obj-y += error-report.o
stub-obj-y += fdset-add-fd.o
stub-obj-y += fdset-find-fd.o
stub-obj-y += fdset-get-fd.o
diff --git a/stubs/error-report.c b/stubs/error-report.c
new file mode 100644
index 0000000..e39d0a9
--- /dev/null
+++ b/stubs/error-report.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+#include "qemu/error-report.h"
+
+void error_report(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+}
--
1.8.3.1
next prev parent reply other threads:[~2013-08-21 12:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 12:26 [Qemu-devel] [PATCH 0/2] osdep: warn if opening a file O_DIRECT on tmpfs fails Stefan Hajnoczi
2013-08-21 12:26 ` Stefan Hajnoczi [this message]
2013-08-21 13:04 ` [Qemu-devel] [PATCH 1/2] stubs: add error_report() Markus Armbruster
2013-08-21 13:15 ` Stefan Hajnoczi
2013-08-21 12:26 ` [Qemu-devel] [PATCH 2/2] osdep: warn if opening a file O_DIRECT on tmpfs fails Stefan Hajnoczi
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=1377088001-8783-2-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=deepakcs@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--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).