summary refs log tree commit diff stats
path: root/util/qemu-error.c
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2014-10-08 07:11:54 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2014-10-09 15:36:15 +0200
commit5748e4c2be4f5c24c691f91328be02a9c4cb3063 (patch)
tree1badf2fbce035c5fb860833bda54b2a8ff3389f7 /util/qemu-error.c
parent35e4e96c4d5bfcf8a22930d8e99f7c8c44420062 (diff)
downloadfocaccia-qemu-5748e4c2be4f5c24c691f91328be02a9c4cb3063.tar.gz
focaccia-qemu-5748e4c2be4f5c24c691f91328be02a9c4cb3063.zip
qemu-error: Add error_vreport()
Needed to nicely print socket error reports.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util/qemu-error.c')
-rw-r--r--util/qemu-error.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/util/qemu-error.c b/util/qemu-error.c
index 7b167fd06b..9bba5f53d8 100644
--- a/util/qemu-error.c
+++ b/util/qemu-error.c
@@ -199,14 +199,13 @@ static void error_print_loc(void)
 bool enable_timestamp_msg;
 /*
  * Print an error message to current monitor if we have one, else to stderr.
- * Format arguments like sprintf().  The result should not contain
+ * Format arguments like vsprintf().  The result should not contain
  * newlines.
  * Prepend the current location and append a newline.
  * It's wrong to call this in a QMP monitor.  Use qerror_report() there.
  */
-void error_report(const char *fmt, ...)
+void error_vreport(const char *fmt, va_list ap)
 {
-    va_list ap;
     GTimeVal tv;
     gchar *timestr;
 
@@ -218,8 +217,22 @@ void error_report(const char *fmt, ...)
     }
 
     error_print_loc();
-    va_start(ap, fmt);
     error_vprintf(fmt, ap);
-    va_end(ap);
     error_printf("\n");
 }
+
+/*
+ * Print an error message to current monitor if we have one, else to stderr.
+ * Format arguments like sprintf().  The result should not contain
+ * newlines.
+ * Prepend the current location and append a newline.
+ * It's wrong to call this in a QMP monitor.  Use qerror_report() there.
+ */
+void error_report(const char *fmt, ...)
+{
+    va_list ap;
+
+    va_start(ap, fmt);
+    error_vreport(fmt, ap);
+    va_end(ap);
+}