mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
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
This commit is contained in:
parent
deae2bb57f
commit
94d599eccf
@ -5286,12 +5286,14 @@ static int
|
|||||||
cmdVolPath(vshControl *ctl, const vshCmd *cmd)
|
cmdVolPath(vshControl *ctl, const vshCmd *cmd)
|
||||||
{
|
{
|
||||||
virStorageVolPtr vol;
|
virStorageVolPtr vol;
|
||||||
|
char *name = NULL;
|
||||||
|
|
||||||
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
|
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", "pool", NULL,
|
|
||||||
VSH_BYUUID)))
|
if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", &name))) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
vshPrint(ctl, "%s\n", virStorageVolGetPath(vol));
|
vshPrint(ctl, "%s\n", virStorageVolGetPath(vol));
|
||||||
virStorageVolFree(vol);
|
virStorageVolFree(vol);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user