]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Implement --pool option for virsh vol-path
authorDave Allan <dallan@redhat.com>
Mon, 14 Dec 2009 14:17:35 +0000 (15:17 +0100)
committerDaniel Veillard <veillard@redhat.com>
Mon, 14 Dec 2009 14:17:35 +0000 (15:17 +0100)
This patch fixes the problem reported in:

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

The bug reporter says that vol-delete does not support the --pool
option, but that's not the case in the current head.  This patch makes
vol-path behave the same way as vol-delete

* tools/virsh.c: Modified vol-path to use the same logic as vol-delete,
  allowing the syntax: virsh vol-path --pool testdirpool testvol0

tools/virsh.c

index 9c9cd1ed11872fda54f83ab8a8068f38b8650288..65525d439e4575e9d99f131c29e562ad15197d3c 100644 (file)
@@ -5286,12 +5286,14 @@ static int
 cmdVolPath(vshControl *ctl, const vshCmd *cmd)
 {
     virStorageVolPtr vol;
+    char *name = NULL;
 
     if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
         return FALSE;
-    if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", "pool", NULL,
-                                   VSH_BYUUID)))
+
+    if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", &name))) {
         return FALSE;
+    }
 
     vshPrint(ctl, "%s\n", virStorageVolGetPath(vol));
     virStorageVolFree(vol);