From nobody Tue May 7 10:57:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; arc=fail (BodyHash is different from the expected one) Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566898014105299.00440565062866; Tue, 27 Aug 2019 02:26:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3C1683082E25; Tue, 27 Aug 2019 09:26:52 +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 077A660C05; Tue, 27 Aug 2019 09:26:52 +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 2C9651802218; Tue, 27 Aug 2019 09:26:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7R9QnXc012013 for ; Tue, 27 Aug 2019 05:26:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 61EF660127; Tue, 27 Aug 2019 09:26:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx26.extmail.prod.ext.phx2.redhat.com [10.5.110.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A5D160126 for ; Tue, 27 Aug 2019 09:26:47 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 696C48980F1 for ; Tue, 27 Aug 2019 09:26:44 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP FOR libvir-list@redhat.com; Tue, 27 Aug 2019 09:24:46 +0000 Received: from M4W0335.microfocus.com (2002:f78:1193::f78:1193) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 27 Aug 2019 09:17:09 +0000 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0335.microfocus.com (15.120.17.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Tue, 27 Aug 2019 09:17:09 +0000 Received: from MW2PR18MB2300.namprd18.prod.outlook.com (52.132.183.153) by MW2PR18MB2330.namprd18.prod.outlook.com (52.132.183.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.21; Tue, 27 Aug 2019 09:17:02 +0000 Received: from MW2PR18MB2300.namprd18.prod.outlook.com ([fe80::80cb:980c:7e72:17f0]) by MW2PR18MB2300.namprd18.prod.outlook.com ([fe80::80cb:980c:7e72:17f0%7]) with mapi id 15.20.2199.020; Tue, 27 Aug 2019 09:17:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MQfCs1EWw2k6HmXk9iiTf4fjoE6vWEcyecGhxb6Ge/H+PE039NcgSzGFI/jrsSEvNXPm+ChVgBycvJpi0Ebpzo5qLLSv1Kp32RKw75HxZjKhzuKCj2crvqSp26TUeBtwyd53rWU7aN1DskMVpw6VhgySajYulc9XoU3zlaDk2Wzjiaca17uYhhP/nUQEbvBsqmTgdWwiB4vbBmpBEqNQqs1GThUn+frhj2xI+WSWEDuYV4aqttIpoqHB2eFsX2qz1d2ulEm+eU+4LxXbudgcOVPrgvOKKlrcc6X7R/P/rwdIPgJtjKOEfbLM1mMAOr8t8XgN1LllPaOcG4ZIyprdrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0jpPxj8OgeT+oBt0Gr0IivqFfkG+ptr7RPhCMwUXsL4=; b=NNR7ntUaXRI8JzChatwMrFTO5TTMfoaf7HjS1E1TBV93pZIDab2I4awRk2XSZhFq7rD94z04IZDgnB2xZrBKGhV9JNdeKhi5dLYHFH71pSjaEsmxW3NVr43z++K60JeEb25isJ8VqB9L7zufzrvatnU3wdHJYPCg+87bkBRhpXVNX2ik0dOhGZdPZKaIT7Aaa/gPZHl37Z+LWOkXxDKfHEaRmr9rVtofemQjtQGPojw5q4q1W6/FDMB9ObMIOEeZyPt/SpRVUCj0rbi0m9Qpbww89KvwD8O1Xo2agthAYn0by0H3+Z6TsLuNDcVtLE4u44bKGZP4olmGN+CNpBf2lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none From: Cedric Bosdonnat To: "libvir-list@redhat.com" Thread-Topic: [PATCH] Generate status of the backend implementation in storage.html Thread-Index: AQHVXLgvJe6Kat/5W0m7t1y+9VhpQg== Date: Tue, 27 Aug 2019 09:17:02 +0000 Message-ID: <20190827091642.10402-1-cbosdonnat@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0169.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::13) To MW2PR18MB2300.namprd18.prod.outlook.com (2603:10b6:907:f::25) authentication-results: spf=none (sender IP is ) smtp.mailfrom=CBosdonnat@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [90.125.147.195] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2b9f5444-87bf-457e-1892-08d72acf5228 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MW2PR18MB2330; x-ms-traffictypediagnostic: MW2PR18MB2330: x-ms-exchange-purlcount: 1 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:370; x-forefront-prvs: 0142F22657 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(396003)(366004)(376002)(39860400002)(346002)(136003)(189003)(199004)(64756008)(66556008)(26005)(14444005)(66446008)(256004)(102836004)(186003)(6506007)(386003)(6916009)(3846002)(14454004)(478600001)(6116002)(71200400001)(71190400001)(2501003)(80792005)(99286004)(66476007)(52116002)(66946007)(6306002)(6486002)(2351001)(5640700003)(6512007)(25786009)(6436002)(86362001)(81166006)(81156014)(8676002)(7736002)(50226002)(8936002)(66066001)(107886003)(53936002)(4326008)(316002)(1076003)(2906002)(2616005)(476003)(486006)(36756003)(5660300002); DIR:OUT; SFP:1102; SCL:1; SRVR:MW2PR18MB2330; H:MW2PR18MB2300.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: WgFsL1+U+dMrVgaFiZYJ4NBUSme8s70q/vTVXOXF/i7oub6rXtBc9dH4HTJqMPRJnMcW7sDfWJCFqhvVDXz3aLvjuA0W7zmgmEvUiRg6eNVpAR99Xv6UnYhvCVikMJLg4dcYM4qQnx8dYFqOVsgVwBLOTgjAGJ+zzQ1O2cMEyml0shEloyFKYHU2/Aj9SkhE7oSyWIhg8LdrRVLKcnxbMYn024WPdSKZUvZ5UMf5868UCNnt1k20KGzKXNfcR1ap+hYmUxsiqzZ0gX6HWCp5fOVZ7LotfAm8NwPRDYDwPanl2xYxo4ztzIL/GD4nrzBJEqCy3TS7Enjo5tSqvaOT+P5F4HLbE5vVGZf20Wko0ZpMoFTk5+RjIsrDBfSHNnWEiVq7unmg6eUVhY+5/yAsMAV9OurYYc9yKB4srB/kqGE= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2b9f5444-87bf-457e-1892-08d72acf5228 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Aug 2019 09:17:02.3789 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uIh35+1ayRRD3dqP1k32Y09EGvq/iamue4d45jPrpcVvKqdEtzFEP1eJ0aO8TZxN7d74ccxYXbIhAgdZAo3u4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR18MB2330 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 27 Aug 2019 09:26:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 27 Aug 2019 09:26:45 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'CBosdonnat@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.67 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x7R9QnXc012013 X-loop: libvir-list@redhat.com Cc: Cedric Bosdonnat Subject: [libvirt] [PATCH] Generate status of the backend implementation in storage.html 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 27 Aug 2019 09:26:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Since it helps a user to know which of the storage backends support what operation, include an autogenerated matrix showing it in the docs. --- .gitignore | 1 + docs/Makefile.am | 9 +++-- docs/apibuild.py | 2 ++ docs/storage.html.in | 14 ++++++++ docs/storagebackendstatus.py | 64 ++++++++++++++++++++++++++++++++++++ 5 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 docs/storagebackendstatus.py diff --git a/.gitignore b/.gitignore index 82495e8692..06875abebd 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ /configure.lineno /conftest.* /docs/aclperms.htmlinc +/docs/storagebackendstatus.htmlinc /docs/apibuild.py.stamp /docs/devhelp/libvirt.devhelp /docs/hvsupport.html.in diff --git a/docs/Makefile.am b/docs/Makefile.am index 1cdb584b0b..526821b1d3 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -195,6 +195,7 @@ EXTRA_DIST=3D \ $(kbase_html_in) $(kbase_html) \ aclperms.htmlinc \ hvsupport.pl \ + storagebackendstatus.py \ $(schema_DATA) =20 acl_generated =3D aclperms.htmlinc @@ -209,7 +210,8 @@ MAINTAINERCLEANFILES =3D \ $(addprefix $(srcdir)/,$(devhelphtml)) \ $(addprefix $(srcdir)/,$(internals_html)) \ $(addprefix $(srcdir)/,$(kbase_html)) \ - $(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc + $(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc \ + $(srcdir)/storagebackendstatus.htmlinc =20 timestamp=3D"$(shell if test -n "$$SOURCE_DATE_EPOCH"; \ then \ @@ -230,6 +232,9 @@ web: $(dot_html) $(internals_html) $(kbase_html) \ =20 hvsupport.html: $(srcdir)/hvsupport.html.in =20 +storagebackendstatus.htmlinc: $(srcdir)/storagebackendstatus.py + $(PYTHON) $< >$@ + $(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \ $(top_srcdir)/src/libvirt_public.syms \ $(top_srcdir)/src/libvirt_qemu.syms $(top_srcdir)/src/libvirt_lxc.syms \ @@ -256,7 +261,7 @@ MAINTAINERCLEANFILES +=3D \ convert -rotate 90 $< $@ =20 %.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \ - $(acl_generated) + $(acl_generated) storagebackendstatus.htmlinc $(AM_V_GEN)name=3D`echo $@ | sed -e 's/.tmp//'`; \ dir=3D`dirname $@` ; \ if test "$$dir" =3D "."; \ diff --git a/docs/apibuild.py b/docs/apibuild.py index dbdc1c95af..31944b8176 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -2010,6 +2010,8 @@ class docBuilder: self.includes =3D includes + list(lxc_included_files.keys()) elif name =3D=3D "libvirt-admin": self.includes =3D includes + list(admin_included_files.keys()) + else: + self.includes =3D includes self.modules =3D {} self.headers =3D {} self.idx =3D index() diff --git a/docs/storage.html.in b/docs/storage.html.in index e0e4edec1e..2e4f662222 100644 --- a/docs/storage.html.in +++ b/docs/storage.html.in @@ -826,5 +826,19 @@ =20

Valid volume format types

The valid volume types are the same as for the directory pool.

+ +

Storage Pool Types implementation status

+ +

+ The storage backends have different level of support of the various = pool and volume actions. + Here is a matrix of the current support for each of them. +

+ +

+ Note: some functions like Start and Stop will not t= rigger an exception when + called on a backend that doesn't implement them. +

+ +
diff --git a/docs/storagebackendstatus.py b/docs/storagebackendstatus.py new file mode 100644 index 0000000000..d105fea626 --- /dev/null +++ b/docs/storagebackendstatus.py @@ -0,0 +1,64 @@ +import os +import os.path +import re + +srcdir =3D os.path.abspath((os.environ.get("srcdir", os.path.join("..", "s= rc")))) + +def get_allowed_functions(): + functions =3D [] + with open(os.path.join(srcdir, 'storage', 'storage_backend.h'), 'r') a= s handle: + content =3D ''.join(handle.readlines()) + definition =3D re.search('struct _virStorageBackend {([^}]+)}', co= ntent) + if definition is not None: + functions =3D re.findall('virStorageBackend[^ ]+ ([^;]+)', def= inition.group(1)) + return functions + +class Backend: + def __init__(self, name, code): + self.name =3D name + self.functions =3D [member[1:] for member in re.findall('.([^ ]+) = =3D ', code) if member !=3D '.type'] + +def get_backends(): + backends =3D [] + for root, dirs, files in os.walk(os.path.join(srcdir, 'storage')): + storage_impls =3D [os.path.join(root, f) for f in files if re.matc= h('storage_backend_[^.]+.c', f)] + for impl in storage_impls: + handle =3D open(impl, 'r') + content =3D ''.join(handle.readlines()) + handle.close() + chunks =3D re.findall('virStorageBackend virStorageBackend([^ = ]+) =3D {([^}]*)}', content) + backends.extend([Backend(chunk[0], chunk[1]) for chunk in chun= ks]) + return backends + +def main(): + functions =3D get_allowed_functions() + backends =3D get_backends() + + headers =3D '\n'.join(['%s' % backend.name for backend in bac= kends]) + rows =3D [] + for func in functions: + cell_template =3D '%s' + support =3D [cell_template % ('✔' if func in backend.functi= ons else '') for backend in backends] + rows.append('\n'.join(['', '%s' % func] + support + [= ''])) + + print(''' + + + + + + + +%s + + + +%s + +
+
+ +''' % (headers, '\n'.join(rows))) + +if __name__ =3D=3D '__main__': + main() --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list