From nobody Fri May 17 01:44:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1676994492; cv=none; d=zohomail.com; s=zohoarc; b=V/KTvxbvaH2yDH9rC8S8AG7QCjjNqBx2dKTeGEKOECfCWL24ab9uxV2TJEO9uAy4KbbNNxptI54+QtG0osMuNBvZAbaCUnd7uR1nfaHSuTrrufphGxXtjM+tiE1IE8ufpIBh5U9efTeOTGjyCqXzowWba95A7VFPTxBSRn8mcsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676994492; 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=iUU4QxG9SywLBfEnZ6o4zTIuCVF5vGzfghZYCUAkRvU=; b=kywvBleHfCN1kMSnvae0EYIWiJGMeYW6SJfOPnWJaAGduxVwvn2Rc8Ya0zfOFDGenVZjTqy/6qmbXyY5k9eI7KwxboM39vvcf9o2+df9XDAWv/XaPFhtuXjdMENHtrN7L3CRmR5iX50BJlRQ5Wwlk36KHiYDD8DqoXqnEcvGLH0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676994492517860.1468542419389; Tue, 21 Feb 2023 07:48:12 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-443-MXDGvOvQNT6xG-VjsbJBFQ-1; Tue, 21 Feb 2023 10:48:06 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 938923C106AA; Tue, 21 Feb 2023 15:47:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7AF34492B11; Tue, 21 Feb 2023 15:47:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5C17019465BD; Tue, 21 Feb 2023 15:47:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9BAC71946587 for ; Tue, 21 Feb 2023 15:47:39 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 900DF492B01; Tue, 21 Feb 2023 15:47:39 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1362B492B00 for ; Tue, 21 Feb 2023 15:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676994491; 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=iUU4QxG9SywLBfEnZ6o4zTIuCVF5vGzfghZYCUAkRvU=; b=Pe15HT1KF5Yrm7fjXobzbqCxzU0BaBVR/4S/1sNcT4HwqhKfzhgj/5iDkwMHpEAQGwp9Qx pX89WrOfZQfeV3URVOSW3XAO7om7U1eRFCDOc/uTaEzLsNqqQGWqKWX6ikTSIvt2MzSfrF LqKHQS8UrF7xSv4HYIUpfpWkvk2YMus= X-MC-Unique: MXDGvOvQNT6xG-VjsbJBFQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/6] remote_protocol: Fix list of supported ACL object names Date: Tue, 21 Feb 2023 16:47:32 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676994493204100005 Content-Type: text/plain; charset="utf-8" Add missing and fix spelling of existing ones. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/remote/remote_protocol.x | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index c34d6f189d..5d86a51116 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -3974,8 +3974,9 @@ enum remote_procedure { * Declare the access control requirements for the API. May be repea= ted * multiple times, if multiple rules are required. * - * is one of 'connect', 'domain', 'network', 'storagepool= ', - * 'interface', 'nodedev', 'secret'. + * is one of 'connect', 'domain', 'interface', 'network', + * 'network_port', 'node_device', 'nwfilter', + * 'nwfilter_binding', 'secret', 'storage_pool', 'storage= _vol' * is one of the permissions in access/viraccessperm.h * indicates the rule only applies if the named flag * is set in the API call --=20 2.39.2 From nobody Fri May 17 01:44:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1676994524; cv=none; d=zohomail.com; s=zohoarc; b=TmVmh1NPMUXgm3DTQ/GszBxwxMap0grWuJWi4UysRPPdVkJouSLhFPiGnJyHELTj7Y47tKBh0M7H/Tj4ePdefi6VkPMXbfyV0W1GDn+jTBGK21Ba+mX65zaKxpR9kutjyxthrcbeIlY82Y6JSHBrubpBS4x3Jh/6NLx+SIMQ7Uc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676994524; 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=ZRItH5vK/Gr58dQBDqKBeKriTKlhX5qYoMan+23N7to=; b=KEQqwjCxuNOy32+JrL60Q7H768y4MylKh1geM2nUALT/TCSAmyzet1uo4k4WdZtbgk/cImajzvguS8k7IcgV8o0rlMhKJf35WnLbRFRxQTNDEUBBDmRhCSoJ/h0ayXdW9g8Fo/uaZzxd0bccxpTJRO7RF57W5TuFXKbk0aplo+Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676994524559362.3977444650793; Tue, 21 Feb 2023 07:48:44 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-xcCRS6dPM0ybfe-G_JAmSQ-1; Tue, 21 Feb 2023 10:48:37 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E042857A99; Tue, 21 Feb 2023 15:47:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38B66492B04; Tue, 21 Feb 2023 15:47:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 937EC1946A79; Tue, 21 Feb 2023 15:47:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8BC6719465BC for ; Tue, 21 Feb 2023 15:47:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 71457492B00; Tue, 21 Feb 2023 15:47:40 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB3CA492B01 for ; Tue, 21 Feb 2023 15:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676994523; 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=ZRItH5vK/Gr58dQBDqKBeKriTKlhX5qYoMan+23N7to=; b=I4wz4Qxaz/78z2e6KLr9VgKnThVyblO4mTZgEpKieQoTGTMfEzY/w8+mVNohuMnMNoEnn2 IJEePWgIWm9/jHoTRIirsZGV6UJRucDH5MK3R2bdsH5ZBWvLB3QZkVyXzzm9zYx5m9IYUD fq0J9Z4VEmBlPCVRbvISsvpxsosj8SE= X-MC-Unique: xcCRS6dPM0ybfe-G_JAmSQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/6] apibuild: Add infrastructure for generating ACL flag info into function docs Date: Tue, 21 Feb 2023 16:47:33 +0100 Message-Id: <6380cc5d6d29abf03bd4cbbeb4841c84f7d3c3ce.1676994420.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676994525511100001 Content-Type: text/plain; charset="utf-8" If the user of the 'docBuilder' class provides a dict (key is API name, value is a tuple of arrays (acls, aclfilters), use the dict to generate ACL definitions into the function definition. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- scripts/apibuild.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/scripts/apibuild.py b/scripts/apibuild.py index 9614709e6c..cced9a5551 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -2071,10 +2071,11 @@ class CParser: class docBuilder: """A documentation builder""" - def __init__(self, name, syms, path=3D'.', directories=3D['.'], includ= es=3D[]): + def __init__(self, name, syms, path=3D'.', directories=3D['.'], includ= es=3D[], acls=3DNone): self.name =3D name self.syms =3D syms self.path =3D path + self.acls =3D acls self.directories =3D directories if name =3D=3D "libvirt": self.includes =3D includes + list(included_files.keys()) @@ -2477,6 +2478,32 @@ class docBuilder: except Exception: print("Exception:", sys.exc_info()[1], file=3Dsys.stderr) self.warning("Failed to save function %s info: %s" % (name, re= pr(id.info))) + + if self.acls and name in self.acls: + acls =3D self.acls[name][0] + aclfilters =3D self.acls[name][1] + + if len(acls) > 0 or len(aclfilters) > 0: + output.write(" \n") + for acl in acls: + comp =3D acl.split(':', 3) + objname =3D comp[0].replace('_', '-') + perm =3D comp[1].replace('_', '-') + output.write(" 2: + output.write(" flags=3D'%s'" % comp[2]) + + output.write("/>\n") + + for aclfilter in aclfilters: + comp =3D aclfilter.split(':', 2) + objname =3D comp[0].replace('_', '-') + perm =3D comp[1].replace('_', '-') + + output.write(" \n" % (objname, perm)) + + output.write(" \n") + output.write(" \n" % (id.type)) def serialize_exports(self, output, file): --=20 2.39.2 From nobody Fri May 17 01:44:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1676994490; cv=none; d=zohomail.com; s=zohoarc; b=ayKmVwnGSOQeztGWTuQXw9uO3lKDtleArrr1x+aC+6j6UtF/o9QZbXhnA537yjiFMoaAcW0E9O8MLppS6CWH9faIoky2o4w84Xbx5T5ju19frFbq7HD7LY14MB4X96yxzT61TSB1hL95ADMbeo793P8GRzLSHSB1BnUNBU8Jx5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676994490; 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=C7XW5fHUQoE3OeF8wKyO8+cCX5WrQ8txJE2KN1UKNSo=; b=KypLtM9q50suCfW6QyQfT3Zi+hOamteSkpE6lzyBt0Xz7jRYu1ud0dZYDRE+17sWXqgilq4DvkF+MwL0Q5RPJH3wS/hYKvLv05qGmzffpT2tle4vGxAgD/bbGIpAIsyTKsUx6l0/eSbFemixYkgWDcxSJ4m9hsb2j7Cn6ZI9NpQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676994490108256.2963675535758; Tue, 21 Feb 2023 07:48:10 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-319-qgaG3xFrM1qQH36oD6VBag-1; Tue, 21 Feb 2023 10:48:06 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EF9173C10694; Tue, 21 Feb 2023 15:47:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4E042026FFF; Tue, 21 Feb 2023 15:47:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3FDC81946A51; Tue, 21 Feb 2023 15:47:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 628051946A43 for ; Tue, 21 Feb 2023 15:47:41 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 44E78492B02; Tue, 21 Feb 2023 15:47:41 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE744492B00 for ; Tue, 21 Feb 2023 15:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676994489; 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=C7XW5fHUQoE3OeF8wKyO8+cCX5WrQ8txJE2KN1UKNSo=; b=c/Mca2Zi0ZSxI4cP3Dt1wmCE+8OzenM+KI11rVyGyEs+m2jwx0uIXia4QayG4XMOHZ2+pM OjjcG+z8tGY1yj1sIm3q8FyBLYyIi094ZK/UH7gtJoeyQF4i3vfSLs10Ie657Ba1ZEhq8y qCnecdvXnPBOw+h4Ce99lkNxd2XPZVI= X-MC-Unique: qgaG3xFrM1qQH36oD6VBag-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/6] scripts/apibuild: Extract and format API ACLs Date: Tue, 21 Feb 2023 16:47:34 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676994491244100002 Content-Type: text/plain; charset="utf-8" As an additional step before processing the API parse the protocol file and extract all ACL definitions. This way we can distribute them for any user of the libvirt API XML files. We will be also able to avoid another call to gendispatch, which generates all this data into a standalone XML. The remote procedure to API name is inspired by what rpcgen does. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/meson.build | 3 + scripts/apibuild.py | 134 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 135 insertions(+), 2 deletions(-) diff --git a/docs/meson.build b/docs/meson.build index 89ac93a958..864abf0ba5 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -160,6 +160,9 @@ docs_api_generated =3D custom_target( libvirt_lxc_sources, admin_sources, util_public_sources, + meson.project_source_root() / 'src' / 'remote' / 'remote_protocol.x', + meson.project_source_root() / 'src' / 'remote' / 'qemu_protocol.x', + meson.project_source_root() / 'src' / 'remote' / 'lxc_protocol.x', ], ) diff --git a/scripts/apibuild.py b/scripts/apibuild.py index cced9a5551..f532dbe834 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -2588,6 +2588,125 @@ class docBuilder: sys.exit(3) +def remoteProcToAPI(remotename: str) -> (str): + components =3D remotename.split('_') + fixednames =3D [] + + if components[1] !=3D "PROC": + raise Exception("Malformed remote function name '%s'" % remotename) + + if components[0] =3D=3D 'REMOTE': + driver =3D '' + elif components[0] =3D=3D 'QEMU': + driver =3D 'Qemu' + elif components[0] =3D=3D 'LXC': + driver =3D 'Lxc' + else: + raise Exception("Unknown remote protocol '%s'" % components[0]) + + for comp in components[2:]: + if comp =3D=3D '': + raise Exception("Invalid empty component in remote procedure n= ame '%s'" % remotename) + + fixedname =3D comp[0].upper() + comp[1:].lower() + + fixedname =3D re.sub('Nwfilter', 'NWFilter', fixedname) + fixedname =3D re.sub('Xml$', 'XML', fixedname) + fixedname =3D re.sub('Xml2$', 'XML2', fixedname) + fixedname =3D re.sub('Uri$', 'URI', fixedname) + fixedname =3D re.sub('Uuid$', 'UUID', fixedname) + fixedname =3D re.sub('Id$', 'ID', fixedname) + fixedname =3D re.sub('Mac$', 'MAC', fixedname) + fixedname =3D re.sub('Cpu$', 'CPU', fixedname) + fixedname =3D re.sub('Os$', 'OS', fixedname) + fixedname =3D re.sub('Nmi$', 'NMI', fixedname) + fixedname =3D re.sub('Pm', 'PM', fixedname) + fixedname =3D re.sub('Fstrim$', 'FSTrim', fixedname) + fixedname =3D re.sub('Fsfreeze$', 'FSFreeze', fixedname) + fixedname =3D re.sub('Fsthaw$', 'FSThaw', fixedname) + fixedname =3D re.sub('Fsinfo$', 'FSInfo', fixedname) + fixedname =3D re.sub('Iothread$', 'IOThread', fixedname) + fixedname =3D re.sub('Scsi', 'SCSI', fixedname) + fixedname =3D re.sub('Wwn$', 'WWN', fixedname) + fixedname =3D re.sub('Dhcp$', 'DHCP', fixedname) + + fixednames.append(fixedname) + + apiname =3D "vir" + fixednames[0] + + # In case of remote procedures for qemu/lxc private APIs we need to add + # the name of the driver in the middle of the string after the object = name. + # For a special case of event callbacks the 'object' name is actually = two + # words: virConenctDomainQemuEvent ... + if fixednames[1] =3D=3D 'Domain': + apiname +=3D 'Domain' + fixednames.pop(1) + + apiname +=3D driver + + for name in fixednames[1:]: + apiname =3D apiname + name + + return apiname + + +def remoteProtocolGetAcls(protocolfilename: str) -> {}: + apiacls =3D {} + + with open(protocolfilename) as proto: + in_procedures =3D False + acls =3D [] + aclfilters =3D [] + + while True: + line =3D proto.readline() + if not line: + break + + if not in_procedures: + if re.match('^enum [a-z]+_procedure {$', line): + in_procedures =3D True + + continue + + if line =3D=3D '};\n': + break + + acl_match =3D re.search(r"\* @acl: ([^\s]+)", line) + + if acl_match: + acls.append(acl_match.group(1)) + continue + + aclfilter_match =3D re.search(r"\* @aclfilter: ([^\s]+)", line) + + if aclfilter_match: + aclfilters.append(aclfilter_match.group(1)) + continue + + remote_proc_match =3D re.search(r"^\s+([A-Z_0-9]+) ", line) + + if remote_proc_match: + proc =3D remote_proc_match.group(1) + apiname =3D remoteProcToAPI(proc) + + if len(acls) =3D=3D 0: + raise Exception("No ACLs for procedure %s(%s)" % proc,= apiname) + + if 'none' in acls: + if len(acls) > 1: + raise Exception("Procedure %s(%s) has 'none' ACL f= ollowed by other ACLs" % proc, apiname) + + acls =3D [] + + apiacls[apiname] =3D (acls, aclfilters) + acls =3D [] + aclfilters =3D [] + continue + + return apiacls + + class app: def warning(self, msg): global warnings @@ -2595,16 +2714,27 @@ class app: print(msg) def rebuild(self, name, srcdir, builddir): + apiacl =3D None + syms =3D { "libvirt": srcdir + "/../src/libvirt_public.syms", "libvirt-qemu": srcdir + "/../src/libvirt_qemu.syms", "libvirt-lxc": srcdir + "/../src/libvirt_lxc.syms", "libvirt-admin": srcdir + "/../src/admin/libvirt_admin_public.= syms", } - if name not in syms: + protocols =3D { + "libvirt": srcdir + "/../src/remote/remote_protocol.x", + "libvirt-qemu": srcdir + "/../src/remote/qemu_protocol.x", + "libvirt-lxc": srcdir + "/../src/remote/lxc_protocol.x", + "libvirt-admin": None, + } + if name not in syms or name not in protocols: self.warning("rebuild() failed, unknown module %s" % name) return None + if protocols[name]: + apiacl =3D remoteProtocolGetAcls(protocols[name]) + builder =3D None if glob.glob(srcdir + "/../src/libvirt.c") !=3D []: if not quiet: @@ -2614,7 +2744,7 @@ class app: srcdir + "/../src/util", srcdir + "/../include/libvirt", builddir + "/../include/libvirt"] - builder =3D docBuilder(name, syms[name], builddir, dirs, []) + builder =3D docBuilder(name, syms[name], builddir, dirs, [], a= piacl) else: self.warning("rebuild() failed, unable to guess the module") return None --=20 2.39.2 From nobody Fri May 17 01:44:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1676994491; cv=none; d=zohomail.com; s=zohoarc; b=aFyOWHVYqW0hanviw0rJmanJJ06+J5pRgNKfZ+KQWEg3pTRsGSfzMsGHRUmWGmJpAtjFVwqOroCy9AFYvgw2e92EN9ibQCxXqgnFfmz72dKlNsf1RGop8ulRV6RoG4WfVHzdXN1jdQfP8juP4CM0YFU7N+a4AsT6KR82R5ygOCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676994491; 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=oqdduys0jcJMgjdSoFAA1dsEGDPYIwZT30TB1vekZSw=; b=cWWtfxFhu1YIo6EiF4AYnP3J8ferMGHlpa70JQFu1/mwTurK1uJz/EFM7PtSMAGrgMhNNnawUCvD+nreyU3R8rcTV+/OIAgurA+AmSR2CjLDAyV31Ri2NpLkIQxbmtzrYIdartIGFBt8bRNahDhOWoNdr3bZyHDaMTfD6hVRnD4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1676994491062756.1422841126226; Tue, 21 Feb 2023 07:48:11 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-284-KYS-7i7TME2CcoykerZk7w-1; Tue, 21 Feb 2023 10:48:06 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B217C8588F3; Tue, 21 Feb 2023 15:47:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C9BA1121314; Tue, 21 Feb 2023 15:47:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CB2B4194973F; Tue, 21 Feb 2023 15:47:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6DD591946A78 for ; Tue, 21 Feb 2023 15:47:42 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 54384492B01; Tue, 21 Feb 2023 15:47:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB728492B00 for ; Tue, 21 Feb 2023 15:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676994490; 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=oqdduys0jcJMgjdSoFAA1dsEGDPYIwZT30TB1vekZSw=; b=AyE9tN5y91zolelBUGKn4yww1bej8jM5eABbNuNgx4vQ2gYZaae6yJYViuu/hB7ayWbANW i3lWnLkNVzBTwP370MK+IQ9ZJZkNFJfvJbkKpXC80xTBZUJy4Yq35Q0kjJX+vlfPwIPuzh O/RL3mDoiiTjV2Pue+bEe0KeqgkqNPo= X-MC-Unique: KYS-7i7TME2CcoykerZk7w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/6] docs/newapi.xsl: Take API flag data from libvirt-api.xml rather than access/libvirt-access.xml Date: Tue, 21 Feb 2023 16:47:35 +0100 Message-Id: <15c4c3e8a8c8537fd4f6951f2a30c62cdd6c2334.1676994420.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676994493208100006 Content-Type: text/plain; charset="utf-8" Since now we embed the data in the libvirt API we don't need to source it from the extra document. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/newapi.xsl | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/docs/newapi.xsl b/docs/newapi.xsl index cc3ec681b7..cc08b8460a 100644 --- a/docs/newapi.xsl +++ b/docs/newapi.xsl @@ -24,22 +24,14 @@ - - html ../ - - - - - - - + - = 0"> + 0">
Access control parameter checks
@@ -49,10 +41,10 @@ - +
Condition
- = 0"> + 0">
Access control return value filters
@@ -61,7 +53,7 @@ - +
Permission
@@ -692,7 +684,7 @@
- +
--=20 2.39.2 From nobody Fri May 17 01:44:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1676994491; cv=none; d=zohomail.com; s=zohoarc; b=bHd2blWrp5XoO1mZ23eOGkUdkRsnL28v4sUF6vXFjQMbecncj+aZxJ2o0vD0CICOJrn0VswJ1vKaGUD1xUyuNfSaF2a0j5RRi+KF7sJ31curGEpGrMc5T4oFhHNli5CM/NUReO9MWi5HQrfd1qKEq+3SsD8xAf0bpmYj/fif/Xk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676994491; 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=+TmC25ciPXQNHK9HeFFs6ONjU799hTYLdhRByuVyXMQ=; b=HAWc4FHvGgVjbVcef+/N1qPrrI5I4wrJlulQrjR5y+tq86WtYbNS8xr07eB6lZQ6Q2glH3cVRwA0PrMZGo18WIqu/9tTD3E9pZRgf04P5ZvgQ3z1h9MT6PbMnWh/4Ee9+A0aaGabFV3K5prEeF63A6wvY5xcGYqgAVShpQHl9FQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 167699449165933.96090828394324; Tue, 21 Feb 2023 07:48:11 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-568-Kn5NKcVFO72vp_KRqUbuRA-1; Tue, 21 Feb 2023 10:48:06 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23B87101A52E; Tue, 21 Feb 2023 15:47:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0484D40168BA; Tue, 21 Feb 2023 15:47:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 852841949753; Tue, 21 Feb 2023 15:47:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3A77019451F8 for ; Tue, 21 Feb 2023 15:47:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2C3D0492B01; Tue, 21 Feb 2023 15:47:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2BF3492B00 for ; Tue, 21 Feb 2023 15:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676994490; 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=+TmC25ciPXQNHK9HeFFs6ONjU799hTYLdhRByuVyXMQ=; b=a5T4hZFl1rQQB6Ibj2NuqwRQSg6cPDo5Y4QiQTu+EqUfRGeubmYdWenSxfKb4/Jiwh28X8 eQ2uIONJszaqlsv4VRtThZDrkN4qfYGWbhnQj5MXbuuPXudGj1T+LtjduZHkGfnnf6prOm E0aLhpaCBftMK3AbFoXXdjpsW6L0wEk= X-MC-Unique: Kn5NKcVFO72vp_KRqUbuRA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/6] docs|access: Don't build the ACL flags into a separate XML Date: Tue, 21 Feb 2023 16:47:36 +0100 Message-Id: <2d64f3a28c9c980bf6f8cbb37a66aa356f0ed395.1676994420.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676994493216100007 Content-Type: text/plain; charset="utf-8" Since we now build it into the libvirt-api.xml or equivalents we don't need the extra XML files. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/html/meson.build | 32 +------------------------------- src/access/meson.build | 16 ---------------- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/docs/html/meson.build b/docs/html/meson.build index 4e818f9142..b18a8ccb5f 100644 --- a/docs/html/meson.build +++ b/docs/html/meson.build @@ -27,14 +27,12 @@ index_api_gen =3D custom_target( command: [ xsltproc_prog, '--nonet', '-o', docs_builddir, '--stringparam', 'builddir', meson.project_build_root(), - '--stringparam', 'aclxmlpath', docs_acl_xml.full_path(), '--stringparam', 'timestamp', docs_timestamp, '--stringparam', 'indexfile', 'index.html', '@INPUT@', ], install: true, install_dir: docs_html_dir / 'html', - depends: docs_acl_xml, depend_files: [ page_xsl, ], @@ -43,7 +41,7 @@ index_api_gen =3D custom_target( docs_html_gen +=3D index_api_gen.to_list() docs_html_dep +=3D index_api_gen -foreach name : [ 'lxc', 'qemu' ] +foreach name : [ 'admin', 'lxc', 'qemu' ] index_api_gen =3D custom_target( 'index-@0@-api'.format(name), input: [ @@ -56,13 +54,11 @@ foreach name : [ 'lxc', 'qemu' ] command: [ xsltproc_prog, '--nonet', '-o', docs_builddir, '--stringparam', 'builddir', meson.project_build_root(), - '--stringparam', 'aclxmlpath', get_variable('docs_acl_@0@_xml'.forma= t(name)).full_path(), '--stringparam', 'timestamp', docs_timestamp, '@INPUT@', ], install: true, install_dir: docs_html_dir / 'html', - depends: get_variable('docs_acl_@0@_xml'.format(name)), depend_files: [ page_xsl, ], @@ -72,32 +68,6 @@ foreach name : [ 'lxc', 'qemu' ] docs_html_dep +=3D index_api_gen endforeach -index_api_gen =3D custom_target( - 'index-admin-api'.format(name), - input: [ - newapi_xsl, - docs_admin_api_xml, - ], - output: [ - 'libvirt-libvirt-admin.html' - ], - command: [ - xsltproc_prog, '--nonet', '-o', docs_builddir, - '--stringparam', 'builddir', meson.project_build_root(), - '--stringparam', 'aclxmlpath', '', - '--stringparam', 'timestamp', docs_timestamp, - '@INPUT@', - ], - install: true, - install_dir: docs_html_dir / 'html', - depend_files: [ - page_xsl, - ], - ) - -docs_html_gen +=3D index_api_gen.to_list() -docs_html_dep +=3D index_api_gen - docs_html_paths =3D [] install_web_deps +=3D docs_html_dep diff --git a/src/access/meson.build b/src/access/meson.build index 0b12581dc1..07c703e8b5 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -23,12 +23,10 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] header_file =3D 'viraccessapicheck.h' source_file =3D 'viraccessapicheck.c' syms_file =3D 'libvirt_access.syms' - xml_file =3D 'libvirt_access.xml' else header_file =3D 'viraccessapicheck@0@.h'.format(name) source_file =3D 'viraccessapicheck@0@.c'.format(name) syms_file =3D 'libvirt_access_@0@.syms'.format(name) - xml_file =3D 'libvirt_access_@0@.xml'.format(name) endif protocol_file =3D remote_path / '@0@_protocol.x'.format(name) @@ -62,22 +60,8 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] gendispatch_prog, '--mode=3Daclsym', name, name.to_upper(), '@INPUT@= ', ] ) - - access_gen_xml +=3D custom_target( - xml_file, - input: protocol_file, - output: xml_file, - capture: true, - command: [ - gendispatch_prog, '--mode=3Daclapi', name, name.to_upper(), '@INPUT@= ', - ], - ) endforeach -docs_acl_xml =3D access_gen_xml[0] -docs_acl_qemu_xml =3D access_gen_xml[1] -docs_acl_lxc_xml =3D access_gen_xml[2] - if conf.has('WITH_POLKIT') access_sources +=3D access_polkit_sources --=20 2.39.2 From nobody Fri May 17 01:44:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1676994490; cv=none; d=zohomail.com; s=zohoarc; b=MwlBdUZDSGG5eeft0ok+Z48FwSIViL7BKj5d9Y41a2joszmVX2flcC/2efzQobH7UkEMeF0u7QALY4C9/l46HEMLJOmCpuclW0PgBpfzemOuFjF51t2uTueAkqP6nfxs82cT8rJHRhNOpyxJX9CfcZ8HDtMRZPSOJOqLBcYoPvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676994490; 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=6Cpx6+CfmAlvLiOXZQy3xm1vfsCFn/ImIG+CwP8ol7s=; b=GW1Tdlsd5R6MU3Wboqf4rjfTMZkxvtUsYXTYXhfPg0BU3wkXHygEV6hsp4XM5ZIHagmIbesdC39niET0Sfdk4BahwQHI0QHc6pzmAhpTPIjCS7PEuTkAAysSFUJobQSQpgh04I1PchlBnWzukNg91nJ6itdw8NT3LHh/cNJeNjg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676994490069985.0499721931134; Tue, 21 Feb 2023 07:48:10 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-473-12vOjYbYMjOGIKUvrBMXZg-1; Tue, 21 Feb 2023 10:48:07 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 77E7280557B; Tue, 21 Feb 2023 15:47:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D733440D9; Tue, 21 Feb 2023 15:47:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0DDE0194037B; Tue, 21 Feb 2023 15:47:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 228F81949751 for ; Tue, 21 Feb 2023 15:47:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EA7CB492B01; Tue, 21 Feb 2023 15:47:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 748E2492B00 for ; Tue, 21 Feb 2023 15:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676994489; 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=6Cpx6+CfmAlvLiOXZQy3xm1vfsCFn/ImIG+CwP8ol7s=; b=htoQ6BmeQZYh3DKi3wNnP4Jm4iIQRZE3nNvyQZ/++IaufmoZw9BE15dabFckn9if8WCDNg UDtXN/jF/45O4HyN4cNSaULnjEmC32ah9vC20WQI3pQpwGhix/a9owbRi/IBguIuEXYHFb SgDHq9dcoVTSRoUh/JsaXa1ujWJWkrE= X-MC-Unique: 12vOjYbYMjOGIKUvrBMXZg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/6] gendispatch: Drop 'aclapi' mode Date: Tue, 21 Feb 2023 16:47:37 +0100 Message-Id: <3f4d21bc75027d2536442ebba55a72b9f2c91d8e.1676994420.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676994491215100001 Content-Type: text/plain; charset="utf-8" The separate API perms XML is no longer used. Remove the support for generating it. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/rpc/gendispatch.pl | 64 ++---------------------------------------- 1 file changed, 3 insertions(+), 61 deletions(-) diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index 4a50ac27e0..b186849606 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -42,8 +42,8 @@ my $res =3D GetOptions("mode=3Ds" =3D> \$mode); die "cannot parse command line options" unless $res; die "unknown mode '$mode', expecting 'client', 'server', " . - "'aclheader', 'aclbody', 'aclsym', 'aclapi' or 'debug'" - unless $mode =3D~ /^(client|server|aclheader|aclbody|aclsym|aclapi|deb= ug)$/; + "'aclheader', 'aclbody', 'aclsym', or 'debug'" + unless $mode =3D~ /^(client|server|aclheader|aclbody|aclsym|debug)$/; my $structprefix =3D shift or die "missing struct prefix argument"; my $procprefix =3D shift or die "missing procedure prefix argument"; @@ -452,14 +452,6 @@ if ($mode eq "aclsym") { # Automatically generated from $protocol by gendispatch.pl. # Do not edit this file. Any changes you make will be lost. __EOF__ -} elsif ($mode eq "aclapi") { - print <<__EOF__; - - -__EOF__ } else { print <<__EOF__; /* Automatically generated from $protocol by gendispatch.pl. @@ -2020,8 +2012,7 @@ elsif ($mode eq "client") { } } elsif ($mode eq "aclheader" || $mode eq "aclbody" || - $mode eq "aclsym" || - $mode eq "aclapi") { + $mode eq "aclsym") { my %generate =3D map { $_ =3D> 1 } @autogen; my @keys =3D keys %calls; @@ -2059,8 +2050,6 @@ elsif ($mode eq "client") { print "\n"; print "#define VIR_FROM_THIS VIR_FROM_ACCESS\n"; print "\n"; - } elsif ($mode eq "aclapi") { - print "\n"; } else { print "\n"; } @@ -2085,8 +2074,6 @@ elsif ($mode eq "client") { print $apiname . "CheckACL;\n"; } print $apiname . "EnsureACL;\n"; - } elsif ($mode eq "aclapi") { - &generate_aclapi($call); } else { &generate_acl($call, $call->{acl}, "Ensure"); if (defined $call->{aclfilter}) { @@ -2247,50 +2234,5 @@ elsif ($mode eq "client") { print "}\n\n"; } } - - sub generate_aclapi { - my $call =3D shift; - - my $apiname =3D $prefix . $call->{ProcName}; - if ($structprefix eq "qemu") { - $apiname =3D~ s/(vir(Connect)?Domain)/${1}Qemu/; - } elsif ($structprefix eq "lxc") { - $apiname =3D~ s/virDomain/virDomainLxc/; - } - - print " \n"; - - my $acl =3D $call->{acl}; - foreach (@{$acl}) { - my @bits =3D split /:/; - my $objname =3D $bits[0]; - $objname =3D~ s/_/-/g; - my $perm =3D $bits[1]; - $perm =3D~ s/_/-/g; - print " \n"; - } - - my $aclfilter =3D $call->{aclfilter}; - foreach (@{$aclfilter}) { - my @bits =3D split /:/; - my $objname =3D $bits[0]; - $objname =3D~ s/_/-/g; - my $perm =3D $bits[1]; - $perm =3D~ s/_/-/g; - - print " \n"; - } - - print " \n"; - } - - } - - if ($mode eq "aclapi") { - print "\n"; } } --=20 2.39.2