[libvirt PATCH] vircgroup: fix g_variant_new_parsed format string causing abort

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

 



The original code was incorrect and never tested because at the time of
implementing it the cgroup file `io.weight` was not available.

Resolves: https://issues.redhat.com/browse/RHEL-45185
Introduced-by: 9c1693eff427661616ce1bd2795688f87288a412
Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/util/vircgroupv1.c | 2 +-
 src/util/vircgroupv2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c
index 77c7e209ce..c1f0562249 100644
--- a/src/util/vircgroupv1.c
+++ b/src/util/vircgroupv1.c
@@ -1225,7 +1225,7 @@ virCgroupV1SetBlkioDeviceWeight(virCgroup *group,
     if (group->unitName) {
         GVariant *value = NULL;
 
-        value = g_variant_new_parsed("[(%s, uint64 %u)]", path, weight);
+        value = g_variant_new_parsed("[(%s, %t)]", path, weight);
 
         return virCgroupSetValueDBus(group->unitName, "BlockIODeviceWeight", value);
     } else {
diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
index db115e25f7..eaf5ae98f6 100644
--- a/src/util/vircgroupv2.c
+++ b/src/util/vircgroupv2.c
@@ -867,7 +867,7 @@ virCgroupV2SetBlkioDeviceWeight(virCgroup *group,
     if (group->unitName) {
         GVariant *value = NULL;
 
-        value = g_variant_new_parsed("[(%s, uint64 %u)]", path, weight);
+        value = g_variant_new_parsed("[(%s, %t)]", path, weight);
 
         return virCgroupSetValueDBus(group->unitName, "IODeviceWeight", value);
     } else {
-- 
2.45.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