mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00: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: 9c1693eff427661616ce1bd2795688f87288a412 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
1bb74349c0
commit
67fdc636bf
@ -1225,7 +1225,7 @@ virCgroupV1SetBlkioDeviceWeight(virCgroup *group,
|
|||||||
if (group->unitName) {
|
if (group->unitName) {
|
||||||
GVariant *value = NULL;
|
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);
|
return virCgroupSetValueDBus(group->unitName, "BlockIODeviceWeight", value);
|
||||||
} else {
|
} else {
|
||||||
|
@ -867,7 +867,7 @@ virCgroupV2SetBlkioDeviceWeight(virCgroup *group,
|
|||||||
if (group->unitName) {
|
if (group->unitName) {
|
||||||
GVariant *value = NULL;
|
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);
|
return virCgroupSetValueDBus(group->unitName, "IODeviceWeight", value);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user