error: New error_printf_unless_qmp()
authorMarkus Armbruster <armbru@redhat.com>
Fri, 19 Feb 2010 09:30:05 +0000 (10:30 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 16 Mar 2010 16:45:34 +0000 (17:45 +0100)
qemu-error.c
qemu-error.h

index a8c178b..5d5fe37 100644 (file)
@@ -41,6 +41,17 @@ void error_printf(const char *fmt, ...)
     va_end(ap);
 }
 
+void error_printf_unless_qmp(const char *fmt, ...)
+{
+    va_list ap;
+
+    if (!monitor_cur_is_qmp()) {
+        va_start(ap, fmt);
+        error_vprintf(fmt, ap);
+        va_end(ap);
+    }
+}
+
 static Location std_loc = {
     .kind = LOC_NONE
 };
index 88e0b70..e63c6ab 100644 (file)
@@ -32,6 +32,8 @@ void loc_set_file(const char *fname, int lno);
 
 void error_vprintf(const char *fmt, va_list ap);
 void error_printf(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
+void error_printf_unless_qmp(const char *fmt, ...)
+    __attribute__ ((format(printf, 1, 2)));
 void error_print_loc(void);
 void error_set_progname(const char *argv0);
 void error_report(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));