From nobody Fri Oct 18 08:44:12 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=1684337514; cv=none; d=zohomail.com; s=zohoarc; b=JJWAmQjS7yyQANjxsnq87eQ4yAqRSimaifB9k7G2WwBCiWUFPMdSo8NU5yExeF0ZpLHLiKeS43M9VQRaWFv4f4WzSVlt1DDttY1NMaAfJEtSzf6PLEzv/YjMJKpZiMqeUCaOyPq24wSDzzHEscxoCQCk0sEJVP4IP4hU95iQBjQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684337514; 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=t5wRsTu/6TwzylnNJYj4pBhwqWDN9bD9xoblUGZYl5k=; b=PepNEpLdH3O4dx3N6leuL5TP+1NiRiia6gdEGgoGD5JYSypt/VvpOFFCc+hYRMr55e2lw8whBgvkd5Y3qEQvdBlwbRzMQxb9Z5VpWci6ZrUPkvzMoVT/mnwVHOSFXrTxwRtQcLFo1rlKE9nEaOQbqUIe22hHxhJ26Xjgc+p8Zvk= 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 1684337514754654.660870441133; Wed, 17 May 2023 08:31:54 -0700 (PDT) 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-344-NUnl7kl6NuyBxzaDAKxqYA-1; Wed, 17 May 2023 11:28:48 -0400 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 846411C00AD3; Wed, 17 May 2023 15:28:26 +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 709F8492B00; Wed, 17 May 2023 15:28:26 +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 48F6B1946A41; Wed, 17 May 2023 15:28:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 556FC19465A4 for ; Wed, 17 May 2023 15:28:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3A5C9C16044; Wed, 17 May 2023 15:28:25 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB4D8C16047 for ; Wed, 17 May 2023 15:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684337513; 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=t5wRsTu/6TwzylnNJYj4pBhwqWDN9bD9xoblUGZYl5k=; b=GEId69LW3Txx7ONkXykXXDmV/INO7Ohe1nrk9s+JGsudUbO6xEiBOfg/BoC5gMRgBK5p7w tUtAQQ06/n2Ht0VjBJZHBmCIdx38TVnuZ8fmGJ300j9kM5fiWcOhsnFiOe+9W7mLmYwprG 1agsncwC5VkZelykfT3Bb4s+6p0Qx90= X-MC-Unique: NUnl7kl6NuyBxzaDAKxqYA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/7] hvsupport: Split out common APIs from hypervisor API section Date: Wed, 17 May 2023 17:28:17 +0200 Message-Id: <89611776cdff6f08fe1ecc8d79eac000d4b86f94.1684336381.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: 1684337515328100001 Content-Type: text/plain; charset="utf-8" Common APIs such as virConnectOpen/Close and similar which are used by the non-hypervisor drivers in libvirt are grouped together with hypervisor drivers, which makes the table very wide. Split them out into a separate group and clean up the list of hypervisor drivers. Signed-off-by: Peter Krempa --- scripts/hvsupport.py | 56 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/scripts/hvsupport.py b/scripts/hvsupport.py index 726385f78e..df1122e123 100755 --- a/scripts/hvsupport.py +++ b/scripts/hvsupport.py @@ -49,8 +49,19 @@ groupheaders =3D { "virStorageDriver": "Storage Pool APIs", "virSecretDriver": "Secret APIs", "virNWFilterDriver": "Network Filter APIs", + "commonapis": "Common driver APIs", } +# List of common APIs used with all driver kinds +commonapis =3D [ + "virConnectOpen", + "virConnectClose", + "virConnectIsAlive", + "virConnectIsEncrypted", + "virConnectIsSecure", + "virConnectSupportsFeature", + "virConnectGetCapabilities", +] srcs =3D [] for root, dirs, files in os.walk(os.path.join(srcdir, "src")): @@ -222,6 +233,10 @@ apis["virDomainMigrateConfirm3Params"] =3D { # Group name -> hash of APIs { fields -> api name } groups =3D {} +groups["commonapis"] =3D { + "apis": {}, + "drivers": {} +} ingrp =3D None for drivertablefile in drivertablefiles: with open(drivertablefile) as fh: @@ -244,7 +259,10 @@ for drivertablefile in drivertablefiles: api =3D "vir" + name if api in apis: - groups[ingrp]["apis"][field] =3D api + if api in commonapis: + groups["commonapis"]["apis"][field] =3D api + else: + groups[ingrp]["apis"][field] =3D api elif re.search(r"\w+(Open|Close|URIProbe)", api) is no= t None: continue else: @@ -288,6 +306,9 @@ for src in srcs: "Group %s already contains %s" % (ingrp, impl)) groups[ingrp]["drivers"][impl] =3D {} + + if impl not in groups["commonapis"]["drivers"]: + groups["commonapis"]["drivers"][impl] =3D {} else: callbackmatch =3D re.search(r"\s*\.(\w+)\s*=3D\s*(\w+)\s*,= ?\s*" + r"(?:/\*\s*(\d+\.\d+\.\d+)\s*" + @@ -317,18 +338,23 @@ for src in srcs: "Method %s in %s is missing version" % (meth, src)) - if api not in groups[ingrp]["apis"]: + if api in groups["commonapis"]["apis"]: + groups["commonapis"]["drivers"][impl][api] =3D { + "vers": vers, + "deleted": deleted, + } + elif api in groups[ingrp]["apis"]: + groups[ingrp]["drivers"][impl][api] =3D { + "vers": vers, + "deleted": deleted, + } + else: if re.search(r"\w+(Open|Close|URIProbe)", api): continue raise Exception("Found unexpected method " + "%s in %s" % (api, ingrp)) - groups[ingrp]["drivers"][impl][api] =3D { - "vers": vers, - "deleted": deleted, - } - if (api =3D=3D "domainMigratePrepare" or api =3D=3D "domainMigratePrepare2" or api =3D=3D "domainMigratePrepare3"): @@ -345,16 +371,16 @@ for src in srcs: # have a bit of manual fixup todo with the per-driver versioning # and support matrix -groups["virHypervisorDriver"]["apis"]["connectOpenAuth"] =3D \ +groups["commonapis"]["apis"]["connectOpenAuth"] =3D \ "virConnectOpenAuth" -groups["virHypervisorDriver"]["apis"]["connectOpenReadOnly"] =3D \ +groups["commonapis"]["apis"]["connectOpenReadOnly"] =3D \ "virConnectOpenReadOnly" groups["virHypervisorDriver"]["apis"]["domainMigrate"] =3D \ "virDomainMigrate" openAuthVers =3D (0 * 1000 * 1000) + (4 * 1000) + 0 -drivers =3D groups["virHypervisorDriver"]["drivers"] +drivers =3D groups["commonapis"]["drivers"] for drv in drivers.keys(): openVersStr =3D drivers[drv]["connectOpen"]["vers"] openVers =3D 0 @@ -381,7 +407,7 @@ for drv in drivers.keys(): "vers": vers, } - +drivers =3D groups["virHypervisorDriver"]["drivers"] # Another special case for the virDomainCreateLinux which was replaced # with virDomainCreateXML groups["virHypervisorDriver"]["apis"]["domainCreateLinux"] =3D \ @@ -389,7 +415,12 @@ groups["virHypervisorDriver"]["apis"]["domainCreateLin= ux"] =3D \ createAPIVers =3D (0 * 1000 * 1000) + (0 * 1000) + 3 -for drv in drivers.keys(): +for drv in list(drivers.keys()): + # drop drivers from the "virHypervisorDriver" group which have only co= mmon APIs + if len(drivers[drv]) =3D=3D 0: + drivers.pop(drv) + continue + if "domainCreateXML" not in drivers[drv]: continue createVersStr =3D drivers[drv]["domainCreateXML"]["vers"] @@ -414,7 +445,6 @@ for drv in drivers.keys(): "vers": vers, } - # Finally we generate the HTML file with the tables print(''' --=20 2.40.1