[PATCH] virsh: don't print --(null) in vol-name and vol-pool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c
index 89ad8ea..0ca295f 100644
--- a/tools/virsh-volume.c
+++ b/tools/virsh-volume.c
@@ -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 "
-- 
1.8.1.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]