From nobody Mon Feb 2 07:17:51 2026 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; 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1767944101; cv=none; d=zohomail.com; s=zohoarc; b=dk30kJYq1XnOvBHiC4Un/00GY8p2da0tdqyO8oRYJ8ZducEv8NjoJur6kujXGD+PKxqe/gRXP5oFOKhnjH5a5fMLyz6vdBSoAjJd5/8cQH44Iolt7RZbLWt54PWDzmlP+GPRxL1ee0hY/l0EBItho38YOGor4q7MSJB4IkhbIzI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767944101; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=qszc3CaHFtMaA1yt6I518S9jBx8LR9M1vWKLslpNSuA=; b=QmAdGIYwVNC1WMNpTo7/og1WiaffmntrzCaFE9x+JQO6Bn/qfATVfmoCuvxkhO/++oB/klTKvM/YGWUA3pt+5xsAsDqWVlkX8TEvK7C3EQdHChc31pqrfVa5JHWwHVkhn70HJdUT3aJO7pyHehZyLCwT52nhXpQXvNtABTc//Ec= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1767944101175655.5299490715429; Thu, 8 Jan 2026 23:35:01 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 335BF43F7C; Fri, 9 Jan 2026 02:35:00 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 6827243EB0; Fri, 9 Jan 2026 02:34:11 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id DF7E943EAA; Fri, 9 Jan 2026 02:34:01 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 21EC343EAE for ; Fri, 9 Jan 2026 02:34:01 -0500 (EST) Received: from mx-prod-mc-03.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-395--p6SP8RHPgCHgQpixZ-IeQ-1; Fri, 09 Jan 2026 02:33:59 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5B4D219560B7 for ; Fri, 9 Jan 2026 07:33:58 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AE21C30002D1 for ; Fri, 9 Jan 2026 07:33:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767944040; 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: in-reply-to:in-reply-to:references:references; bh=qszc3CaHFtMaA1yt6I518S9jBx8LR9M1vWKLslpNSuA=; b=ItE5ejKssNcptu0g2qsoE385LUVtS3t60RcbVgYBgHnr13ncMzIhQZQDGtqgOxEXyVgzjY 7hGPeHM6eBRuIaakPrgDqioj52gCcvlU5BJn2DGWifg+oHKsGmx6A8T5dTWv4YGWZvgeVU gKOI7+ao6Uiv1VhU1ECE1hLJlh8+1Bg= X-MC-Unique: -p6SP8RHPgCHgQpixZ-IeQ-1 X-Mimecast-MFC-AGG-ID: -p6SP8RHPgCHgQpixZ-IeQ_1767944038 To: devel@lists.libvirt.org Subject: [PATCH 1/3] hyperv: Drop const for resourceType in hypervDomainAttachSerial() Date: Fri, 9 Jan 2026 08:33:50 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: PdRAYCIg42L6XZJeS-rECrJIL2IatMCid46kGYWUlMo_1767944038 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: O5SDYWY4C5JH6LWIP36WVYBTG5AJ3PYO X-Message-ID-Hash: O5SDYWY4C5JH6LWIP36WVYBTG5AJ3PYO X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1767944103420158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik The 'resourceType' variable inside of hypervDomainAttachSerial() is declared as both g_autofree and const. This makes no sense. Since the variable is g_strdup_printf()-ed into a couple of lines later, it's not const. Drop that part of variable declaration. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/hyperv/hyperv_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 0c17ef16ec..8dd56f39dc 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -974,7 +974,7 @@ hypervDomainAttachSerial(virDomainPtr domain, virDomain= ChrDef *serial) Msvm_ResourceAllocationSettingData *entry =3D NULL; g_autoptr(GHashTable) serialResource =3D NULL; const char *connectionValue =3D NULL; - g_autofree const char *resourceType =3D NULL; + g_autofree char *resourceType =3D NULL; =20 virUUIDFormat(domain->uuid, uuid_string); =20 --=20 2.52.0 From nobody Mon Feb 2 07:17:51 2026 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; 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1767944223; cv=none; d=zohomail.com; s=zohoarc; b=QRDf8MqaHZJI+bLxkqoSLc/JE8mH9Pk8xK3cEoU5Qzgk9Fkb3t+HoPykDrCccIlcGFk+E4moWatK1z6a28li8Gd+P3YOrb5uITh+6zEbFSw91Df58n0N0HSFBVGf8SVmcK3Q8Rc1GbBPxhtGOgcTNhhqxXtkXYNfblm1Xf+vhSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767944223; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=GwO72fnp3FbzqoDYArGoGTKnr9hOsG8IACZTXBmEZ6Y=; b=M+kyJ1RZb7jOMaLjyG3BeoBKjqK4X4FtaamWZzygzBcMjKxP5QsiUczieNpxKGH9PT5IujTaSAl0cav5t/hP1ZpMAoHvmx42ywBCSqXO0A9QAzC3CbdPkaBvKszs1ozx1S12zyAUEYfqzHpw7iAc18VSnGnWqFeTaZcRwx6ykOM= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1767944223311993.6490626254262; Thu, 8 Jan 2026 23:37:03 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id B817143F7C; Fri, 9 Jan 2026 02:37:02 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 3949B4407C; Fri, 9 Jan 2026 02:34:21 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id A67EC43EAE; Fri, 9 Jan 2026 02:34:03 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 0D5E843E98 for ; Fri, 9 Jan 2026 02:34:03 -0500 (EST) Received: from mx-prod-mc-03.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-463--0mM_oHyMHetPioTb-826w-1; Fri, 09 Jan 2026 02:34:00 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 63892195605B for ; Fri, 9 Jan 2026 07:33:59 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B666530002D1 for ; Fri, 9 Jan 2026 07:33:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767944042; 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: in-reply-to:in-reply-to:references:references; bh=GwO72fnp3FbzqoDYArGoGTKnr9hOsG8IACZTXBmEZ6Y=; b=fxb04wW5mxnQMK9HojDcw4xG7vHAJq0KK73HfztgMYRzvqIEVobQ3yvWJyx0a8lBjTKxUU vj4Nj1InI/bnZdomZ+GjmTUdfVqUIuXmGiPKqnD+8L7j2RW4DF54C8DW7Rs20IklQ1VPus PhS1m5TIL6315zXDmCK3/pOIVSfPORo= X-MC-Unique: -0mM_oHyMHetPioTb-826w-1 X-Mimecast-MFC-AGG-ID: -0mM_oHyMHetPioTb-826w_1767944039 To: devel@lists.libvirt.org Subject: [PATCH 2/3] network: Drop const for forwardIf in pfAddNatFirewallRules() Date: Fri, 9 Jan 2026 08:33:51 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5O7-XdVPQ4gWa3--CccE9HfjzE3nfVsJw7JgCbN_3fE_1767944039 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: VWF6BJN4IE4SXPOY6G4FBHY6P4NVUNVC X-Message-ID-Hash: VWF6BJN4IE4SXPOY6G4FBHY6P4NVUNVC X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1767944224838158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik The 'forwardIf' variable inside of pfAddNatFirewallRules() is declared as both g_autofree and const. This makes no sense. Since the variable is g_strdup()-ed into right in the declaration, it's not const. Drop that part of variable declaration. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark Reviewed-by: Roman Bogorodskiy --- src/network/network_pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/network_pf.c b/src/network/network_pf.c index 34e2f60e82..724b82c054 100644 --- a/src/network/network_pf.c +++ b/src/network/network_pf.c @@ -165,7 +165,7 @@ pfAddNatFirewallRules(virNetworkDef *def, * block log on virbr0 */ int prefix =3D virNetworkIPDefPrefix(ipdef); - g_autofree const char *forwardIf =3D g_strdup(virNetworkDefForwardIf(d= ef, 0)); + g_autofree char *forwardIf =3D g_strdup(virNetworkDefForwardIf(def, 0)= ); g_auto(virBuffer) pf_rules_buf =3D VIR_BUFFER_INITIALIZER; g_autoptr(virCommand) cmd =3D virCommandNew(PFCTL); g_autoptr(virCommand) flush_cmd =3D virCommandNew(PFCTL); --=20 2.52.0 From nobody Mon Feb 2 07:17:51 2026 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; 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1767944270; cv=none; d=zohomail.com; s=zohoarc; b=D48GIP1p/4p19/T0vt92YukiOe1AC+zz8xw7w8Wubylc0Ma0IxYoTUS1bUv6fLOx2hVivQQI0wVz04x9AhoYqLp9Rm3f0SSHose+MKiu4moq4Exc6XPXYumyxxG7E+v6xKJ54UtAifhHQ49GhXstmtX+KJTtop2angcO01DpV28= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767944270; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=aqe3OMuun0UXrWGJYrxaA6mt6v6puNKkh4nwysphHVY=; b=N/RKkFLr8wNncA4FGWV3pqEYnYJqADL2Evabhu/mo8LOSgypG1ExoxIxoE7fZtUXXHagLxyTKozigly81Z5VOPo0ZCwLhRAlt6Lu2UQ/nehBN4nv4RLPsznN09am6DhfhxbO6eRnMFDXFgCmghE+7vIWw9JBWoAx+LyVVPIv/Vc= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1767944270778867.5415934016701; Thu, 8 Jan 2026 23:37:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id F076743EAA; Fri, 9 Jan 2026 02:37:49 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 53588440C5; Fri, 9 Jan 2026 02:34:25 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id DBF1E43E90; Fri, 9 Jan 2026 02:34:03 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 3F09243EAD for ; Fri, 9 Jan 2026 02:34:03 -0500 (EST) Received: from mx-prod-mc-03.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-246-X-1uuhC4Mw27iDE76mNHFA-1; Fri, 09 Jan 2026 02:34:01 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7A3AA1956050 for ; Fri, 9 Jan 2026 07:34:00 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CD2F830002D1 for ; Fri, 9 Jan 2026 07:33:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767944042; 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: in-reply-to:in-reply-to:references:references; bh=aqe3OMuun0UXrWGJYrxaA6mt6v6puNKkh4nwysphHVY=; b=fkx/3Dbn3l/Rhrz0HkdTvFzISifbLShH7x7eJ/SylP3kvcszsj4f4voPixvB/dv2y6OKmB YN0L9gEp5MenuNG2cE9RmsgYwpBC89cgNTRgjEPVsyirTR81JCpdwI+LnZO2yDH3jL40CX kgsoLbBMfXO/bPuYpsb1XshYQknYV2Y= X-MC-Unique: X-1uuhC4Mw27iDE76mNHFA-1 X-Mimecast-MFC-AGG-ID: X-1uuhC4Mw27iDE76mNHFA_1767944040 To: devel@lists.libvirt.org Subject: [PATCH 3/3] syntax-check: Introduce sc_prohibit_g_autofree_const rule Date: Fri, 9 Jan 2026 08:33:52 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: xyPbA-gZUV5sDo8gdCpUf7_Kz9jdEUJ7ucAk84Q-EF0_1767944040 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FVIP3ROWGRLLKZMTVUHVHMIG327P2CSE X-Message-ID-Hash: FVIP3ROWGRLLKZMTVUHVHMIG327P2CSE X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1767944271009158500 From: Michal Privoznik The aim of this rule is to capture the following pattern: g_autofree const char *var =3D ...; The pattern is problematic, because it frees a const pointer. If written the old way, we'd get a compiler warning: warning: passing argument 1 of =E2=80=98free=E2=80=99 discards =E2=80=98c= onst=E2=80=99 qualifier from pointer target type [-Wdiscarded-qualifiers] Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- build-aux/syntax-check.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 4deaa70368..f605c9b0e3 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -389,6 +389,12 @@ sc_prohibit_unsigned_pid: halt=3D'use signed type for pid values' \ $(_sc_search_regexp) =20 +sc_prohibit_g_autofree_const: + @prohibit=3D'\.* const.* \*[^*]' \ + halt=3D'=E2=80=98g_autofree=E2=80=99 discards =E2=80=98const=E2=80=99 qua= lifier from pointer target type' \ + $(_sc_search_regexp) + + # Many of the function names below came from this filter: # git grep -B2 '\<_('|grep -E '\.c- *[[:alpha:]_][[:alnum:]_]* ?\(.*[,;]$'= \ # |sed 's/.*\.c- *//'|perl -pe 's/ ?\(.*//'|sort -u \ --=20 2.52.0