mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
domain_cgroup.c: update domain after setting blkio.weight
Commitac87d3520aconsolidated common cgroup code between the QEMU and lxc drivers in domain_cgroup.c. In this process, in virDomainCgroupSetupDomainBlkioParameters(), a call to virCgroupGetBlkioWeight() went missing. The result is that 'virsh blkiotune' is setting the blkio.weight for the guest in the host cgroup, but not on the domain XML, because virCgroupGetBlkioWeight() is also used to write the blkio.weight value in the domain object. Fix it by adding the virCgroupGetBlkioWeight() call in the virDomainCgroupSetupDomainBlkioParameters() helper. Fixes:ac87d3520aResolves: https://bugzilla.redhat.com/show_bug.cgi?id=1941407 Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
@@ -104,7 +104,8 @@ virDomainCgroupSetupDomainBlkioParameters(virCgroupPtr cgroup,
|
||||
virTypedParameterPtr param = ¶ms[i];
|
||||
|
||||
if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
|
||||
if (virCgroupSetBlkioWeight(cgroup, params[i].value.ui) < 0)
|
||||
if (virCgroupSetBlkioWeight(cgroup, params[i].value.ui) < 0 ||
|
||||
virCgroupGetBlkioWeight(cgroup, &def->blkio.weight) < 0)
|
||||
ret = -1;
|
||||
} else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) ||
|
||||
STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) ||
|
||||
|
||||
Reference in New Issue
Block a user