]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Fix error message on vol-create-from failure
authorRyota Ozaki <ozaki.ryota@gmail.com>
Mon, 24 Oct 2011 11:44:04 +0000 (20:44 +0900)
committerEric Blake <eblake@redhat.com>
Fri, 28 Oct 2011 03:28:22 +0000 (21:28 -0600)
If vol-create-from is failed due to 'input volume not found',
virsh outputs like this:
  $ sudo virsh vol-create-from testpool test-vol.xml test.img
  error: failed to get vol 'test.img', specifying --pool might help
  error: Storage volume not found: no storage vol with matching path
However, '--pool' is incorrect because it is already specified as
second argument ('testpool' in this case). It should be "--inputpool".

The patch fixes this by using pooloptname, which will be "inputpool"
in this case and "pool" in other cases, as error message.

tools/virsh.c

index 72344f0ba25b9c101ca9ec9a41157413a49be261..5544a4116542051a4bdc9e18bce8ca516a473eae 100644 (file)
@@ -15216,8 +15216,8 @@ vshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
         if (pool)
             vshError(ctl, _("failed to get vol '%s'"), n);
         else
-            vshError(ctl, _("failed to get vol '%s', specifying --pool "
-                            "might help"), n);
+            vshError(ctl, _("failed to get vol '%s', specifying --%s "
+                            "might help"), n, pooloptname);
     }
 
     if (pool)