From nobody Sun Feb 8 13:32:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615485288; cv=none; d=zohomail.com; s=zohoarc; b=nkpwhKZhwCWjm3Ys0tWl+QFIhb+cJaAiPZbMJNiDO44hZkt2A4Xh2odYYt7AnviMyfbH9pC6h4qpXIwqXhHhg2qRzbJ0eLLp+uvKSA5Oi1Z+5SFkqHMooPbqZw/gMDX4aK/P1+j7EiYTO9cqoeJ0Tknwv0FgnAGzTUWbA1ZTSW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615485288; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hAxoTrfLN14ZGhWGn5N1ELPygHihpx3rpoCdpT1EcAg=; b=jh9QggHnbCgWe5mezQxuaiVodrfPcUc51OheNEd5RdIfRhpucp9qt2moYWfzsipbJnyFeRTY6Vsn8EtarSHqxza1pdICLE9oc4YBG8Us/4c+UQ1gxEbVHEwMcsh+Q5DalYXkVw1fxDxQ4OHdjcRjszrSdP3GWrd/wsVFPDTzXZk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1615485288411523.088803984325; Thu, 11 Mar 2021 09:54:48 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-xPrGm71xOca3qs-4rvasrQ-1; Thu, 11 Mar 2021 12:54:44 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C39E83DD24; Thu, 11 Mar 2021 17:54:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E7BBE5945E; Thu, 11 Mar 2021 17:54:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AE5D11800847; Thu, 11 Mar 2021 17:54:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12BHsSUR027022 for ; Thu, 11 Mar 2021 12:54:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3CE125C255; Thu, 11 Mar 2021 17:54:28 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id B51B85C23E for ; Thu, 11 Mar 2021 17:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615485287; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hAxoTrfLN14ZGhWGn5N1ELPygHihpx3rpoCdpT1EcAg=; b=gGHXBXZARLtETOi18CdjFTQs6QECV6AaqcczU0xm+xsWMvFNJTS/PiZ7txELXofsTgikTO Dc8retXXoqSpoV70FmHWKzLQGz37dzBrguUH8uKycOrMcqaLwTc7Ao8Eb1ZGf7LUqQtLrs 9EEgYijoCEXgwmoaT+EAWK0URL3Jiqo= X-MC-Unique: xPrGm71xOca3qs-4rvasrQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/6] syntax-check: Fix and rename virSecurity rule Date: Thu, 11 Mar 2021 18:54:17 +0100 Message-Id: <0fa8804242f662949dafcfd29f6ed2e8e8624cbd.1615484196.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The aim of virSecurity rule is to discourage from using plain virSecurityManager*() APIs within QEMU driver in favor of their qemuSecurity*() counterparts. The reason is simple: namespaces; virSecurityManager*() needs additional virSecurityManagerTransactionCommit() call to enter given namespace and do its work from there. And that's exactly what those qemuSecurity*() wrappers do. To help us ensure correctness (from this POV), we have a syntax-check rule that forbids any occurrence of "virSecurityManager" string under src/qemu/ (except for qemu_security of course). But with if we want to remove virSecurityManagerPtr type, then we have to allow "virSecurityManager *". Therefore, change the rule so that no call of a function with "virSecurityManager" prefix is allowed. And also change the name to better reflect what is going on. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- build-aux/syntax-check.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 2f4f932a5b..c71b608e66 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1049,10 +1049,10 @@ sc_prohibit_sysconf_pagesize: halt=3D'use virGetSystemPageSize[KB] instead of sysconf(_SC_PAGESIZE)' \ $(_sc_search_regexp) =20 -sc_prohibit_virSecurity: +sc_prohibit_virSecurityManager: @$(VC_LIST_EXCEPT) | $(GREP) 'src/qemu/' | \ $(GREP) -v 'src/qemu/qemu_security' | \ - xargs $(GREP) -Pn 'virSecurityManager(?!Ptr)' /dev/null && \ + xargs $(GREP) -Pn 'virSecurityManager\S*\(' /dev/null && \ { echo '$(ME): prefer qemuSecurity wrappers' 1>&2; exit 1; } || : =20 sc_prohibit_pthread_create: --=20 2.26.2