]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Update blkio.weight value after successful set
authorLuyao Huang <lhuang@redhat.com>
Wed, 19 Aug 2015 03:56:33 +0000 (11:56 +0800)
committerCole Robinson <crobinso@redhat.com>
Tue, 22 Sep 2015 00:18:02 +0000 (20:18 -0400)
https://bugzilla.redhat.com/show_bug.cgi?id=1253107

Make a call virCgroupGetBlkioWeight to re-read blkio.weight right
after it is set in order to keep internal data up-to-date.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
(cherry picked from commit bf2788218ad29719467260aa4ecad6dc31c97046)

src/qemu/qemu_driver.c

index d6c04f3f6917a9f922ad8f73dc54d42f1e033f8c..f2b43c42771c071ad2a1d90bf1fb3301ca03feb9 100644 (file)
@@ -9185,7 +9185,8 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
             virTypedParameterPtr param = &params[i];
 
             if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
-                if (virCgroupSetBlkioWeight(priv->cgroup, param->value.ui) < 0)
+                if (virCgroupSetBlkioWeight(priv->cgroup, param->value.ui) < 0 ||
+                    virCgroupGetBlkioWeight(priv->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) ||