mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
qemu_driver: Resolve Coverity COPY_PASTE_ERROR
In qemuDomainSetBlkioParameters(), Coverity points out that the calls to qemuDomainParseBlkioDeviceStr() are slightly different and points out there may be a cut-n-paste error. In the first call (AFFECT_LIVE), the second parameter is "param->field"; however, for the second call (AFFECT_CONFIG), the second parameter is "params->field". It seems the "param->field" is correct especially since each path as a setting of "param" to "¶ms[i]". Furthermore, there were a few more instances of using "params[i]" instead of "param->" which I cleaned up. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
b635b7a1af
commit
f72f064269
@ -7826,7 +7826,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
|
||||
virTypedParameterPtr param = ¶ms[i];
|
||||
|
||||
if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
|
||||
if (virCgroupSetBlkioWeight(priv->cgroup, params[i].value.ui) < 0)
|
||||
if (virCgroupSetBlkioWeight(priv->cgroup, param->value.ui) < 0)
|
||||
ret = -1;
|
||||
} else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) ||
|
||||
STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) ||
|
||||
@ -7837,7 +7837,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
|
||||
virBlkioDevicePtr devices = NULL;
|
||||
size_t j;
|
||||
|
||||
if (qemuDomainParseBlkioDeviceStr(params[i].value.s,
|
||||
if (qemuDomainParseBlkioDeviceStr(param->value.s,
|
||||
param->field,
|
||||
&devices,
|
||||
&ndevices) < 0) {
|
||||
@ -7920,7 +7920,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
|
||||
virTypedParameterPtr param = ¶ms[i];
|
||||
|
||||
if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
|
||||
persistentDef->blkio.weight = params[i].value.ui;
|
||||
persistentDef->blkio.weight = param->value.ui;
|
||||
} else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) ||
|
||||
STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) ||
|
||||
STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS) ||
|
||||
@ -7929,8 +7929,8 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
|
||||
virBlkioDevicePtr devices = NULL;
|
||||
size_t ndevices;
|
||||
|
||||
if (qemuDomainParseBlkioDeviceStr(params[i].value.s,
|
||||
params->field,
|
||||
if (qemuDomainParseBlkioDeviceStr(param->value.s,
|
||||
param->field,
|
||||
&devices,
|
||||
&ndevices) < 0) {
|
||||
ret = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user