@samitouri / QOSamiQemu / commits / c6ea6ce1e6

qemu-print: Document qemu_fprintf(), qemu_vfprintf() failure

These functions fail when @stream is null and the current monitor isn't HMP. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20260114124713.3308719-4-armbru@redhat.com> [Comments rewritten in review]

Markus Armbruster committed Jan 14, 2026 at 13:47 UTC c6ea6ce1e6fa0b0b1b8d11ca56c3b669c639c90c
1 file changed +8 -2
util/qemu-print.c
+8 -2
@@ -44,7 +44,10 @@ int qemu_printf(const char *fmt, ...)
44
45 /*
46 * Print like vfprintf()
47 - * Print to @stream if non-null, else to current monitor.
47 + * Print to @stream if non-null, else to current HMP monitor if we
48 + * have one, else fail without printing anything.
49 + * Return number of characters printed on success, negative value on
50 + * error.
51 */
52 int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap)
53 {
@@ -56,7 +59,10 @@ int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap)
59
60 /*
61 * Print like fprintf().
59 - * Print to @stream if non-null, else to current monitor.
62 + * Print to @stream if non-null, else to current HMP monitor if we
63 + * have one, else fail without printing anything.
64 + * Return number of characters printed on success, negative value on
65 + * error.
66 */
67 int qemu_fprintf(FILE *stream, const char *fmt, ...)
68 {