mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
vircgroup: fix g_variant_new_parsed format string causing abort
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: 9c1693eff4
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
committed by
Jiri Denemark
parent
1bb74349c0
commit
67fdc636bf
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user