mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-07 09:19:19 +00:00
virsh: Actually make blkdeviotune --group_name work
Function vshCommandOptStringReq() returns -1 on error and 0 on success. The code, however, used the 'group_name' variable only if it returned 1 (never). Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
87ee705183
commit
a20e8bcad5
@ -1398,11 +1398,12 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
|
|||||||
VSH_ADD_IOTUNE(write-iops-sec-max-length, WRITE_IOPS_SEC_MAX_LENGTH);
|
VSH_ADD_IOTUNE(write-iops-sec-max-length, WRITE_IOPS_SEC_MAX_LENGTH);
|
||||||
#undef VSH_ADD_IOTUNE
|
#undef VSH_ADD_IOTUNE
|
||||||
|
|
||||||
rv = vshCommandOptStringReq(ctl, cmd, "group_name", &group_name);
|
if (vshCommandOptStringReq(ctl, cmd, "group_name", &group_name) < 0) {
|
||||||
if (rv < 0) {
|
|
||||||
vshError(ctl, "%s", _("Unable to parse group parameter"));
|
vshError(ctl, "%s", _("Unable to parse group parameter"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else if (rv > 0) {
|
}
|
||||||
|
|
||||||
|
if (group_name) {
|
||||||
if (virTypedParamsAddString(¶ms, &nparams, &maxparams,
|
if (virTypedParamsAddString(¶ms, &nparams, &maxparams,
|
||||||
VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME,
|
VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME,
|
||||||
group_name) < 0)
|
group_name) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user