2 * Print to stream or current monitor
4 * Copyright (C) 2019 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.
13 #include "qemu/osdep.h"
14 #include "monitor/monitor.h"
15 #include "qemu/qemu-print.h"
18 * Print like vprintf().
19 * Print to current monitor if we have one, else to stdout.
21 int qemu_vprintf(const char *fmt
, va_list ap
)
24 return monitor_vprintf(cur_mon
, fmt
, ap
);
26 return vprintf(fmt
, ap
);
30 * Print like printf().
31 * Print to current monitor if we have one, else to stdout.
33 int qemu_printf(const char *fmt
, ...)
39 ret
= qemu_vprintf(fmt
, ap
);
45 * Print like vfprintf()
46 * Print to @stream if non-null, else to current monitor.
48 int qemu_vfprintf(FILE *stream
, const char *fmt
, va_list ap
)
51 return monitor_vprintf(cur_mon
, fmt
, ap
);
53 return vfprintf(stream
, fmt
, ap
);
57 * Print like fprintf().
58 * Print to @stream if non-null, else to current monitor.
60 int qemu_fprintf(FILE *stream
, const char *fmt
, ...)
66 ret
= qemu_vfprintf(stream
, fmt
, ap
);