From nobody Thu Apr 30 14:19:16 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; 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=1745915680; cv=none; d=zohomail.com; s=zohoarc; b=Q+qZU+Q9xAvNc29GafPbJnwI1nqhPZa8//3qjfD9V8pT7n+RUBuMAqNBbcsHV3JwK/8T/C66G1hiurlJbuqeqrfhGaL6YtS/Oz5XxAIkCB4NCRf1cRLE0MQ8uNJPrJxoY1Ri5bH/JC+GU1j9T/NwI0++n+ubkuQGlbGaVvEBG64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745915680; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post: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=FWW0hv/yxbtby2uJeooayzDHApfvt9YG00th5WfiHXQ=; b=UByDasV4nCImvW3gucJ+T5DKvdG2TBpwi5s661mwkcE2tI7JYx+pdKDyC4UPgoJzWsDOTriWipCExf6x/QODrlrNViXFM0NbcbFKe3ETjmoL9RnCgBfpI+6evhKjIDEJg9tEnls5iBiJSaAdl3Aaez2YfIJsWrsXvSBwQUHV4H8= 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 1745915680754165.71533462981176; Tue, 29 Apr 2025 01:34:40 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id AB328E96; Tue, 29 Apr 2025 04:34:39 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8B5EC12A0; Tue, 29 Apr 2025 04:32:03 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1067EB38; Tue, 29 Apr 2025 04:31:55 -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 C4B36B69 for ; Tue, 29 Apr 2025 04:31:53 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-178-YRN6eKNXPUC11yfgg2G77A-1; Tue, 29 Apr 2025 04:31:51 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D8ABC180087F for ; Tue, 29 Apr 2025 08:31:50 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.3.236]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 415C5180045C for ; Tue, 29 Apr 2025 08:31:50 +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.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,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=1745915513; 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=TfGn56zosrW2f4U8U7HPmt8o+CVjhfVVFnYCfT37LgQ=; b=Bvl0LR8RhVDfSENOWdeOH/HJzohTr6c8n7IsR7n1pY/pjvs0f9XKCxhRVRsIr9J6fOpHKl X/BUQOWgGfQM47YsyAMTPFhT0aQoiP3mAW03A+TEBTpLqqUjW8SY2GIbZCv0AbMcexTQoL 6gW/+XT0LkZCQMzTNaNNcGNNXJwkeVg= X-MC-Unique: YRN6eKNXPUC11yfgg2G77A-1 X-Mimecast-MFC-AGG-ID: YRN6eKNXPUC11yfgg2G77A_1745915511 To: devel@lists.libvirt.org Subject: [PATCH v2 3/3] scripts: Adapt mock-noinline.py to ATTRIBUTE_MOCKABLE Date: Tue, 29 Apr 2025 10:31:43 +0200 Message-ID: <54aa18ddd0b1c7d71047998812408a40f8b1962c.1745914265.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8Z6oUVjjL68MD8r4_Z7zPqjDVgYk88Wwx5YscgdAa38_1745915511 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: VGFV2D7KN6ERH2CPNNAZEHK4SYVFTGVK X-Message-ID-Hash: VGFV2D7KN6ERH2CPNNAZEHK4SYVFTGVK X-MailFrom: mprivozn@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: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1745915683528019100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik The script is renamed to mockable-attribute.py and adjusted to check for the new attribute. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- build-aux/syntax-check.mk | 4 ++-- scripts/meson.build | 2 +- scripts/{mock-noinline.py =3D> mockable-attribute.py} | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) rename scripts/{mock-noinline.py =3D> mockable-attribute.py} (91%) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index d414e033df..09d3a5620c 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1326,9 +1326,9 @@ sc_spacing-check: $(PERL) $(top_srcdir)/build-aux/check-spacing.pl || \ { echo 'incorrect formatting' 1>&2; exit 1; } =20 -sc_mock-noinline: +sc_mockable-attribute: $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | $(RUNUTF8) \ - $(PYTHON) $(top_srcdir)/scripts/mock-noinline.py + $(PYTHON) $(top_srcdir)/scripts/mockable-attribute.py =20 sc_header-ifdef: $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[h]$$' | $(RUNUTF8) xargs \ diff --git a/scripts/meson.build b/scripts/meson.build index 2798e302ab..15a23e8738 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -29,7 +29,7 @@ scripts =3D [ 'meson-install-web.py', 'meson-python.sh', 'meson-timestamp.py', - 'mock-noinline.py', + 'mockable-attribute.py', 'prohibit-duplicate-header.py', 'qemu-replies-tool.py', ] diff --git a/scripts/mock-noinline.py b/scripts/mockable-attribute.py similarity index 91% rename from scripts/mock-noinline.py rename to scripts/mockable-attribute.py index 77a5ca23e2..c6695773e7 100755 --- a/scripts/mock-noinline.py +++ b/scripts/mockable-attribute.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2017-2019 Red Hat, Inc. +# Copyright (C) 2017-2025 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -22,7 +22,7 @@ import sys noninlined =3D {} mocked =3D {} =20 -# Functions in public header don't get the noinline annotation +# Functions in public header don't get the noipa annotation noninlined["virEventAddTimeout"] =3D True # This one confuses the script as its defined in the mock file # but is actually just a local helper @@ -43,7 +43,7 @@ def scan_annotations(filename): elif line.isspace(): func =3D None =20 - if "G_NO_INLINE" in line: + if "ATTRIBUTE_MOCKABLE" in line: if func is not None: noninlined[func] =3D True =20 @@ -74,7 +74,7 @@ warned =3D False for func in mocked.keys(): if func not in noninlined: warned =3D True - print("%s is mocked at %s but missing 'G_NO_INLINE' annotation" % + print("%s is mocked at %s but missing 'ATTRIBUTE_MOCKABLE' annotat= ion" % (func, mocked[func]), file=3Dsys.stderr) =20 if warned: --=20 2.49.0