From: John Ferlan Date: Mon, 16 Apr 2018 15:40:23 +0000 (-0400) Subject: virsh: Clear vsh last error during virshCommandOptVolBy X-Git-Tag: v4.3.0-rc1~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d6e8341031ab1b23b89c15574b2b0a08ef3c3b1;p=thirdparty%2Flibvirt.git virsh: Clear vsh last error during virshCommandOptVolBy https://bugzilla.redhat.com/show_bug.cgi?id=1529256 If one of the virStorageVolLookupBy{Key|Name|Path} succeeds and we have a @vol, then clear the last libvirt error; otherwise, a subsequent "other" failure may cause vshReportError to erroneously report the wrong error as well as a reported 'vshError' error that caused the failure. Signed-off-by: John Ferlan --- diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index bacbec0d27..9d6ebd2325 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -129,6 +129,8 @@ virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd, else vshError(ctl, _("failed to get vol '%s', specifying --%s " "might help"), n, pooloptname); + } else { + vshResetLibvirtError(); } /* If the pool was specified, then make sure that the returned