]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu-print: Document qemu_fprintf(), qemu_vfprintf() failure
authorMarkus Armbruster <armbru@redhat.com>
Wed, 14 Jan 2026 12:47:13 +0000 (13:47 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2026 10:52:26 +0000 (12:52 +0200)
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]

util/qemu-print.c

index 4a30cd1a8ec00a00e3046bb91371148dc23aaee8..7b9591035e57c111a3170753974522907c1ae507 100644 (file)
@@ -44,7 +44,10 @@ int qemu_printf(const char *fmt, ...)
 
 /*
  * Print like vfprintf()
- * Print to @stream if non-null, else to current monitor.
+ * Print to @stream if non-null, else to current HMP monitor if we
+ * have one, else fail without printing anything.
+ * Return number of characters printed on success, negative value on
+ * error.
  */
 int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap)
 {
@@ -56,7 +59,10 @@ int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap)
 
 /*
  * Print like fprintf().
- * Print to @stream if non-null, else to current monitor.
+ * Print to @stream if non-null, else to current HMP monitor if we
+ * have one, else fail without printing anything.
+ * Return number of characters printed on success, negative value on
+ * error.
  */
 int qemu_fprintf(FILE *stream, const char *fmt, ...)
 {