From: Daniel Henrique Barboza Date: Mon, 22 Mar 2021 19:28:59 +0000 (-0300) Subject: domain_cgroup.c: update domain after setting blkio.weight X-Git-Tag: v7.2.0-rc1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2602f2bb186da100116a5668d95ca829b7f2767;p=thirdparty%2Flibvirt.git domain_cgroup.c: update domain after setting blkio.weight Commit ac87d3520ad5 consolidated 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: ac87d3520ad542d558854a72b0ae0a81fddc6747 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1941407 Reviewed-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza --- diff --git a/src/hypervisor/domain_cgroup.c b/src/hypervisor/domain_cgroup.c index eb4fa20a9e..05e3aa7e6a 100644 --- a/src/hypervisor/domain_cgroup.c +++ b/src/hypervisor/domain_cgroup.c @@ -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) ||