[PATCH 1/1] domain_cgroup.c: update domain after setting blkio.weight

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: 5493217b940ee9ea72b581270adb3ab9ba245148
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1941407
Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
---
 src/hypervisor/domain_cgroup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 = &params[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) ||
-- 
2.30.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux