From: Jiri Denemark Date: Thu, 22 May 2025 12:13:15 +0000 (+0200) Subject: virsh: Do not print warnings with "error:" prefix X-Git-Tag: v11.4.0-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47431165f4b7baf748da3d49a7d72f4f87ea6149;p=thirdparty%2Flibvirt.git virsh: Do not print warnings with "error:" prefix Both vshWarn and vshError are just wrappers around vshPrintStderr which properly propagates the message level to the log, but fails to honor it when printing on stderr. https://issues.redhat.com/browse/RHEL-79460 Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- diff --git a/tools/vsh.c b/tools/vsh.c index 05845e2c1e..e892cbca22 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2123,7 +2123,11 @@ vshPrintStderr(vshControl *ctl, * printing to stderr will not interleave correctly with stdout * unless we flush between every transition between streams. */ fflush(stdout); - fprintf(stderr, _("error: %1$s\n"), NULLSTR(str)); + + if (level == VSH_ERR_WARNING) + fprintf(stderr, _("warning: %1$s\n"), NULLSTR(str)); + else + fprintf(stderr, _("error: %1$s\n"), NULLSTR(str)); fflush(stderr); }