On Wed, Jan 14, 2026 at 01:47:13PM +0100, Markus Armbruster wrote:
> These functions fail when @stream is null and the current monitor
> isn't HMP.
> 
> Signed-off-by: Markus Armbruster <[email protected]>
> ---
>  util/qemu-print.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/util/qemu-print.c b/util/qemu-print.c
> index 4a30cd1a8e..bbf8c1823e 100644
> --- a/util/qemu-print.c
> +++ b/util/qemu-print.c
> @@ -45,6 +45,7 @@ int qemu_printf(const char *fmt, ...)
>  /*
>   * Print like vfprintf()
>   * Print to @stream if non-null, else to current monitor.
> + * Beware: the latter fails unless we have one and it is HMP.

This leaves me curious what 'fails' means. In this case no
output is printed and the func returns -1.

How about we rephrase to match the other method docs better

 * Print to current HMP monitor if we have one, else to @stream
   if non-null, else returns -1


>   */
>  int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap)
>  {
> @@ -57,6 +58,7 @@ int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap)
>  /*
>   * Print like fprintf().
>   * Print to @stream if non-null, else to current monitor.
> + * Beware: the latter fails unless we have one and it is HMP.
>   */
>  int qemu_fprintf(FILE *stream, const char *fmt, ...)
>  {
> -- 
> 2.52.0
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to