From nobody Mon Sep 16 19:20:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1719504351041914.2387522454045; Thu, 27 Jun 2024 09:05:51 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 92911BD6; Thu, 27 Jun 2024 12:05:49 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 5CCF0BA6; Thu, 27 Jun 2024 12:05:34 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id F3CD9BA5; Thu, 27 Jun 2024 12:05:31 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8C98BB67 for ; Thu, 27 Jun 2024 12:05:31 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-266--JNdV45tM9e3vHRnqTWXYQ-1; Thu, 27 Jun 2024 12:05:29 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 885551944D36 for ; Thu, 27 Jun 2024 16:05:28 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.226.18]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AC6A319560A3 for ; Thu, 27 Jun 2024 16:05:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719504331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S5m3Ffpk0sPgkYdH9JgUnHkg3w4QqMiwv5n7Uumixtw=; b=Go3YJQhsBIMW9WXFIWQMtCIOkRijP6TlvCFwY77CGhod9iXfndFk1JhdmRSSXvpwgycboN 5N8hkGsR63RCd2BrpPX6Odj1Moq/6uo+MGpJjmSVwFBRn7vZpZegsVPOBz8xAv+zZbPEku CVmDum3b8gyYts0kUJL6XF0/RdY5pfE= X-MC-Unique: -JNdV45tM9e3vHRnqTWXYQ-1 From: Pavel Hrdina To: devel@lists.libvirt.org Subject: [libvirt PATCH] vircgroup: fix g_variant_new_parsed format string causing abort Date: Thu, 27 Jun 2024 18:05:18 +0200 Message-ID: <038d6e2792ea209b51042730e2494a19af7e7e03.1719504308.git.phrdina@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZE4HUCXQBVOPLCHIDZXJ5UEXZAWYHKXV X-Message-ID-Hash: ZE4HUCXQBVOPLCHIDZXJ5UEXZAWYHKXV X-MailFrom: phrdina@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1719504352726100001 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Reviewed-by: Jiri Denemark --- 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 =3D NULL; =20 - value =3D g_variant_new_parsed("[(%s, uint64 %u)]", path, weight); + value =3D g_variant_new_parsed("[(%s, %t)]", path, weight); =20 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 =3D NULL; =20 - value =3D g_variant_new_parsed("[(%s, uint64 %u)]", path, weight); + value =3D g_variant_new_parsed("[(%s, %t)]", path, weight); =20 return virCgroupSetValueDBus(group->unitName, "IODeviceWeight", va= lue); } else { --=20 2.45.2