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
};
int i;
const char *const *argp;
- if (!cur_mon) {
+ if (!cur_mon && progname) {
fprintf(stderr, "%s:", progname);
sep = " ";
}
error_printf(" ");
break;
default:
- error_printf(sep);
+ error_printf("%s", sep);
}
}
va_end(ap);
error_printf("\n");
}
-
-void qerror_report_internal(const char *file, int linenr, const char *func,
- const char *fmt, ...)
-{
- va_list va;
- QError *qerror;
-
- va_start(va, fmt);
- qerror = qerror_from_info(file, linenr, func, fmt, &va);
- va_end(va);
-
- if (cur_mon) {
- monitor_set_error(cur_mon, qerror);
- } else {
- qerror_print(qerror);
- QDECREF(qerror);
- }
-}