mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
virsh: Back out if the argument for vol-create-as is malformed
This commit is contained in:
parent
68fcfdb8bd
commit
ee58b581c4
@ -11372,18 +11372,24 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
|
|||||||
|
|
||||||
if (vshCommandOptString(cmd, "capacity", &capacityStr) <= 0)
|
if (vshCommandOptString(cmd, "capacity", &capacityStr) <= 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if (vshVolSize(capacityStr, &capacity) < 0)
|
|
||||||
|
if (vshVolSize(capacityStr, &capacity) < 0) {
|
||||||
vshError(ctl, _("Malformed size %s"), capacityStr);
|
vshError(ctl, _("Malformed size %s"), capacityStr);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (vshCommandOptString(cmd, "allocation", &allocationStr) > 0 &&
|
if (vshCommandOptString(cmd, "allocation", &allocationStr) > 0 &&
|
||||||
vshVolSize(allocationStr, &allocation) < 0)
|
vshVolSize(allocationStr, &allocation) < 0) {
|
||||||
vshError(ctl, _("Malformed size %s"), allocationStr);
|
vshError(ctl, _("Malformed size %s"), allocationStr);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (vshCommandOptString(cmd, "format", &format) < 0 ||
|
if (vshCommandOptString(cmd, "format", &format) < 0 ||
|
||||||
vshCommandOptString(cmd, "backing-vol", &snapshotStrVol) < 0 ||
|
vshCommandOptString(cmd, "backing-vol", &snapshotStrVol) < 0 ||
|
||||||
vshCommandOptString(cmd, "backing-vol-format",
|
vshCommandOptString(cmd, "backing-vol-format",
|
||||||
&snapshotStrFormat) < 0) {
|
&snapshotStrFormat) < 0) {
|
||||||
vshError(ctl, "%s", _("missing argument"));
|
vshError(ctl, "%s", _("missing argument"));
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user