mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-22 14:09:22 +00:00
virsh: Fix vol-name and vol-pool commands
This commands don't have a --pool option, so don't tell vshCommandOptVolBy that there could be one. This made vshCommandOptString for pooloptname fail and an "missing option" error was reported. Make pooloptname optional for vshCommandOptVolBy.
This commit is contained in:
parent
2f6239d068
commit
c9ee3d2675
@ -9201,7 +9201,7 @@ cmdVolName(vshControl *ctl, const vshCmd *cmd)
|
|||||||
if (!vshConnectionUsability(ctl, ctl->conn))
|
if (!vshConnectionUsability(ctl, ctl->conn))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", "pool", NULL,
|
if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", NULL, NULL,
|
||||||
VSH_BYUUID)))
|
VSH_BYUUID)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -9238,7 +9238,7 @@ cmdVolPool(vshControl *ctl, const vshCmd *cmd)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Use the supplied string to locate the volume */
|
/* Use the supplied string to locate the volume */
|
||||||
if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", "pool", NULL,
|
if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", NULL, NULL,
|
||||||
VSH_BYUUID))) {
|
VSH_BYUUID))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -13619,7 +13619,7 @@ vshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
|
|||||||
if (vshCommandOptString(cmd, optname, &n) <= 0)
|
if (vshCommandOptString(cmd, optname, &n) <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (vshCommandOptString(cmd, pooloptname, &p) < 0) {
|
if (pooloptname != NULL && vshCommandOptString(cmd, pooloptname, &p) < 0) {
|
||||||
vshError(ctl, "%s", _("missing option"));
|
vshError(ctl, "%s", _("missing option"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user