]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: don't print --(null) in vol-name and vol-pool
authorJán Tomko <jtomko@redhat.com>
Fri, 22 Mar 2013 11:32:32 +0000 (12:32 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 22 Mar 2013 12:05:46 +0000 (13:05 +0100)
Don't print the pool option name if it's null.

Before:
virsh # vol-name vol
error: failed to get vol 'vol', specifying --(null) might help
error: Storage volume not found: no storage vol with matching path vol

After:

virsh # vol-name vol
error: failed to get vol 'vol'
error: Storage volume not found: no storage vol with matching path vol

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=924571

tools/virsh-volume.c

index 89ad8ea2164d7dfa36bdff3cf21c15d76eebd022..0ca295f3cdc16bbf514e125c2fbdeb360f70e04f 100644 (file)
@@ -88,7 +88,7 @@ vshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
     }
 
     if (!vol) {
-        if (pool)
+        if (pool || !pooloptname)
             vshError(ctl, _("failed to get vol '%s'"), n);
         else
             vshError(ctl, _("failed to get vol '%s', specifying --%s "