From: Dave Allan Date: Mon, 14 Dec 2009 14:17:35 +0000 (+0100) Subject: Implement --pool option for virsh vol-path X-Git-Tag: v0.7.5~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94d599eccf43fa1ab84d6b312559b132404f88e4;p=thirdparty%2Flibvirt.git Implement --pool option for virsh vol-path 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 --- diff --git a/tools/virsh.c b/tools/virsh.c index 9c9cd1ed11..65525d439e 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -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);