4 * Copyright (C) 2010 Red Hat Inc.
7 * Markus Armbruster <armbru@redhat.com>,
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
18 * Print to current monitor if we have one, else to stderr.
19 * TODO should return int, so callers can calculate width, but that
20 * requires surgery to monitor_vprintf(). Left for another day.
22 void error_vprintf(const char *fmt
, va_list ap
)
25 monitor_vprintf(cur_mon
, fmt
, ap
);
27 vfprintf(stderr
, fmt
, ap
);
32 * Print to current monitor if we have one, else to stderr.
33 * TODO just like error_vprintf()
35 void error_printf(const char *fmt
, ...)
40 error_vprintf(fmt
, ap
);
45 * Print an error message to current monitor if we have one, else to stderr.
46 * Appends a newline to the message.
47 * It's wrong to call this in a QMP monitor. Use qemu_error_new() there.
49 void error_report(const char *fmt
, ...)
54 error_vprintf(fmt
, ap
);
59 void qemu_error_internal(const char *file
, int linenr
, const char *func
,
66 qerror
= qerror_from_info(file
, linenr
, func
, fmt
, &va
);
70 monitor_set_error(cur_mon
, qerror
);