From nobody Mon May 13 23:43:38 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=suse.de 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 1647937176657992.0381476181304; Tue, 22 Mar 2022 01:19:36 -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-548-GtlHzO8NPrymz8UHDzoaPw-1; Tue, 22 Mar 2022 04:19:28 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BB18328035E3; Tue, 22 Mar 2022 08:19:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42C8440CF8EF; Tue, 22 Mar 2022 08:19:25 +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 C8FC11949762; Tue, 22 Mar 2022 08:19:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AAD211947BBC for ; Tue, 22 Mar 2022 08:19:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 879F340D2821; Tue, 22 Mar 2022 08:19:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8381B40D1B9B for ; Tue, 22 Mar 2022 08:19:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 67CEE3C01C17 for ; Tue, 22 Mar 2022 08:19:23 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556-C2acrbogNEyLe_SKAwQpTQ-1; Tue, 22 Mar 2022 04:19:19 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 44761210F2; Tue, 22 Mar 2022 08:19:18 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 02DCB133DD; Tue, 22 Mar 2022 08:19:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id O3xuOYWGOWLOZwAAMHmgww (envelope-from ); Tue, 22 Mar 2022 08:19:17 +0000 X-MC-Unique: GtlHzO8NPrymz8UHDzoaPw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: C2acrbogNEyLe_SKAwQpTQ-1 From: Claudio Fontana To: Andrea Bolognani Subject: [libvirt PATCH v2] schemas: move out of docs, fix no-docs build Date: Tue, 22 Mar 2022 09:18:57 +0100 Message-Id: <20220322081857.5010-1-cfontana@suse.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: , Cc: libvir-list@redhat.com, Claudio Fontana Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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-ZM-MESSAGEID: 1647937178925100001 Content-Type: text/plain; charset="utf-8" schemas are used for more than just documentation, virsh edit fails if schemas are not available. Therefore, fix the no-docs build by moving schemas/ to the parsing code inside src/conf/. Signed-off-by: Claudio Fontana Reviewed-by: Andrea Bolognani --- changes v1 -> v2: * move to src/conf/ instead of top_srcdir (Daniel) * meson, rename docs_schema_files to just schema_files (Daniel) * tests/virschematest.c: adapt (Andrea) * src/util/virxml.c: adapt (Andrea) * src/conf/cpu_conf.c: adapt (Andrea) * docs/api_extension.rst: adapt one additional reference docs/api_extension.rst | 2 +- docs/meson.build | 2 -- src/conf/cpu_conf.c | 2 +- src/conf/meson.build | 2 ++ {docs =3D> src/conf}/schemas/basictypes.rng | 0 {docs =3D> src/conf}/schemas/capability.rng | 0 {docs =3D> src/conf}/schemas/cpu.rng | 0 {docs =3D> src/conf}/schemas/cputypes.rng | 0 {docs =3D> src/conf}/schemas/domain.rng | 0 {docs =3D> src/conf}/schemas/domainbackup.rng | 0 {docs =3D> src/conf}/schemas/domaincaps.rng | 0 .../conf}/schemas/domaincheckpoint.rng | 0 {docs =3D> src/conf}/schemas/domaincommon.rng | 0 {docs =3D> src/conf}/schemas/domainsnapshot.rng | 0 {docs =3D> src/conf}/schemas/interface.rng | 0 {docs =3D> src/conf}/schemas/meson.build | 4 +-- {docs =3D> src/conf}/schemas/network.rng | 0 {docs =3D> src/conf}/schemas/networkcommon.rng | 0 {docs =3D> src/conf}/schemas/networkport.rng | 0 {docs =3D> src/conf}/schemas/nodedev.rng | 0 {docs =3D> src/conf}/schemas/nwfilter.rng | 0 .../conf}/schemas/nwfilter_params.rng | 0 .../conf}/schemas/nwfilterbinding.rng | 0 {docs =3D> src/conf}/schemas/secret.rng | 0 {docs =3D> src/conf}/schemas/storagecommon.rng | 0 {docs =3D> src/conf}/schemas/storagepool.rng | 0 .../conf}/schemas/storagepoolcaps.rng | 0 {docs =3D> src/conf}/schemas/storagevol.rng | 0 src/util/virxml.c | 2 +- tests/virschematest.c | 36 ++++++++++--------- 30 files changed, 26 insertions(+), 24 deletions(-) rename {docs =3D> src/conf}/schemas/basictypes.rng (100%) rename {docs =3D> src/conf}/schemas/capability.rng (100%) rename {docs =3D> src/conf}/schemas/cpu.rng (100%) rename {docs =3D> src/conf}/schemas/cputypes.rng (100%) rename {docs =3D> src/conf}/schemas/domain.rng (100%) rename {docs =3D> src/conf}/schemas/domainbackup.rng (100%) rename {docs =3D> src/conf}/schemas/domaincaps.rng (100%) rename {docs =3D> src/conf}/schemas/domaincheckpoint.rng (100%) rename {docs =3D> src/conf}/schemas/domaincommon.rng (100%) rename {docs =3D> src/conf}/schemas/domainsnapshot.rng (100%) rename {docs =3D> src/conf}/schemas/interface.rng (100%) rename {docs =3D> src/conf}/schemas/meson.build (83%) rename {docs =3D> src/conf}/schemas/network.rng (100%) rename {docs =3D> src/conf}/schemas/networkcommon.rng (100%) rename {docs =3D> src/conf}/schemas/networkport.rng (100%) rename {docs =3D> src/conf}/schemas/nodedev.rng (100%) rename {docs =3D> src/conf}/schemas/nwfilter.rng (100%) rename {docs =3D> src/conf}/schemas/nwfilter_params.rng (100%) rename {docs =3D> src/conf}/schemas/nwfilterbinding.rng (100%) rename {docs =3D> src/conf}/schemas/secret.rng (100%) rename {docs =3D> src/conf}/schemas/storagecommon.rng (100%) rename {docs =3D> src/conf}/schemas/storagepool.rng (100%) rename {docs =3D> src/conf}/schemas/storagepoolcaps.rng (100%) rename {docs =3D> src/conf}/schemas/storagevol.rng (100%) diff --git a/docs/api_extension.rst b/docs/api_extension.rst index 16d4b0a005..d70c244fd4 100644 --- a/docs/api_extension.rst +++ b/docs/api_extension.rst @@ -73,7 +73,7 @@ The first task is to define the public API. If the new AP= I involves an XML extension, you have to enhance the RelaxNG schema and document the new elements or attributes: =20 -``docs/schemas/domaincommon.rng docs/formatdomain.html.in`` +``src/conf/schemas/domaincommon.rng docs/formatdomain.html.in`` =20 If the API extension involves a new function, you have to add a declaration in the public header, and arrange to export the function diff --git a/docs/meson.build b/docs/meson.build index 868267b764..7aebe08047 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -334,8 +334,6 @@ subdir('js') subdir('kbase') subdir('logos') subdir('manpages') -subdir('schemas') - =20 foreach file : docs_assets # This hack enables us to view the web pages diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 819efcea8c..2d447da7c3 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -345,7 +345,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, g_autofree char *schemafile =3D NULL; =20 if (!(schemafile =3D virFileFindResource("cpu.rng", - abs_top_srcdir "/docs/schem= as", + abs_top_srcdir "/src/conf/s= chemas", PKGDATADIR "/schemas"))) return -1; =20 diff --git a/src/conf/meson.build b/src/conf/meson.build index bd35d87e0a..82d265e975 100644 --- a/src/conf/meson.build +++ b/src/conf/meson.build @@ -111,3 +111,5 @@ virt_conf_lib =3D static_library( libvirt_libs +=3D virt_conf_lib =20 conf_inc_dir =3D include_directories('.') + +subdir('schemas') diff --git a/docs/schemas/basictypes.rng b/src/conf/schemas/basictypes.rng similarity index 100% rename from docs/schemas/basictypes.rng rename to src/conf/schemas/basictypes.rng diff --git a/docs/schemas/capability.rng b/src/conf/schemas/capability.rng similarity index 100% rename from docs/schemas/capability.rng rename to src/conf/schemas/capability.rng diff --git a/docs/schemas/cpu.rng b/src/conf/schemas/cpu.rng similarity index 100% rename from docs/schemas/cpu.rng rename to src/conf/schemas/cpu.rng diff --git a/docs/schemas/cputypes.rng b/src/conf/schemas/cputypes.rng similarity index 100% rename from docs/schemas/cputypes.rng rename to src/conf/schemas/cputypes.rng diff --git a/docs/schemas/domain.rng b/src/conf/schemas/domain.rng similarity index 100% rename from docs/schemas/domain.rng rename to src/conf/schemas/domain.rng diff --git a/docs/schemas/domainbackup.rng b/src/conf/schemas/domainbackup.= rng similarity index 100% rename from docs/schemas/domainbackup.rng rename to src/conf/schemas/domainbackup.rng diff --git a/docs/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng similarity index 100% rename from docs/schemas/domaincaps.rng rename to src/conf/schemas/domaincaps.rng diff --git a/docs/schemas/domaincheckpoint.rng b/src/conf/schemas/domainche= ckpoint.rng similarity index 100% rename from docs/schemas/domaincheckpoint.rng rename to src/conf/schemas/domaincheckpoint.rng diff --git a/docs/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.= rng similarity index 100% rename from docs/schemas/domaincommon.rng rename to src/conf/schemas/domaincommon.rng diff --git a/docs/schemas/domainsnapshot.rng b/src/conf/schemas/domainsnaps= hot.rng similarity index 100% rename from docs/schemas/domainsnapshot.rng rename to src/conf/schemas/domainsnapshot.rng diff --git a/docs/schemas/interface.rng b/src/conf/schemas/interface.rng similarity index 100% rename from docs/schemas/interface.rng rename to src/conf/schemas/interface.rng diff --git a/docs/schemas/meson.build b/src/conf/schemas/meson.build similarity index 83% rename from docs/schemas/meson.build rename to src/conf/schemas/meson.build index bb6a48787f..700161bf75 100644 --- a/docs/schemas/meson.build +++ b/src/conf/schemas/meson.build @@ -1,4 +1,4 @@ -docs_schema_files =3D [ +schema_files =3D [ 'basictypes.rng', 'capability.rng', 'cpu.rng', @@ -24,4 +24,4 @@ docs_schema_files =3D [ 'storagevol.rng', ] =20 -install_data(docs_schema_files, install_dir: pkgdatadir / 'schemas') +install_data(schema_files, install_dir: pkgdatadir / 'schemas') diff --git a/docs/schemas/network.rng b/src/conf/schemas/network.rng similarity index 100% rename from docs/schemas/network.rng rename to src/conf/schemas/network.rng diff --git a/docs/schemas/networkcommon.rng b/src/conf/schemas/networkcommo= n.rng similarity index 100% rename from docs/schemas/networkcommon.rng rename to src/conf/schemas/networkcommon.rng diff --git a/docs/schemas/networkport.rng b/src/conf/schemas/networkport.rng similarity index 100% rename from docs/schemas/networkport.rng rename to src/conf/schemas/networkport.rng diff --git a/docs/schemas/nodedev.rng b/src/conf/schemas/nodedev.rng similarity index 100% rename from docs/schemas/nodedev.rng rename to src/conf/schemas/nodedev.rng diff --git a/docs/schemas/nwfilter.rng b/src/conf/schemas/nwfilter.rng similarity index 100% rename from docs/schemas/nwfilter.rng rename to src/conf/schemas/nwfilter.rng diff --git a/docs/schemas/nwfilter_params.rng b/src/conf/schemas/nwfilter_p= arams.rng similarity index 100% rename from docs/schemas/nwfilter_params.rng rename to src/conf/schemas/nwfilter_params.rng diff --git a/docs/schemas/nwfilterbinding.rng b/src/conf/schemas/nwfilterbi= nding.rng similarity index 100% rename from docs/schemas/nwfilterbinding.rng rename to src/conf/schemas/nwfilterbinding.rng diff --git a/docs/schemas/secret.rng b/src/conf/schemas/secret.rng similarity index 100% rename from docs/schemas/secret.rng rename to src/conf/schemas/secret.rng diff --git a/docs/schemas/storagecommon.rng b/src/conf/schemas/storagecommo= n.rng similarity index 100% rename from docs/schemas/storagecommon.rng rename to src/conf/schemas/storagecommon.rng diff --git a/docs/schemas/storagepool.rng b/src/conf/schemas/storagepool.rng similarity index 100% rename from docs/schemas/storagepool.rng rename to src/conf/schemas/storagepool.rng diff --git a/docs/schemas/storagepoolcaps.rng b/src/conf/schemas/storagepoo= lcaps.rng similarity index 100% rename from docs/schemas/storagepoolcaps.rng rename to src/conf/schemas/storagepoolcaps.rng diff --git a/docs/schemas/storagevol.rng b/src/conf/schemas/storagevol.rng similarity index 100% rename from docs/schemas/storagevol.rng rename to src/conf/schemas/storagevol.rng diff --git a/src/util/virxml.c b/src/util/virxml.c index 268aad1d20..8ff59e7cda 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -1099,7 +1099,7 @@ virXMLParseHelper(int domcode, =20 if (validate && schemafile !=3D NULL) { g_autofree char *schema =3D virFileFindResource(schemafile, - abs_top_srcdir "/doc= s/schemas", + abs_top_srcdir "/src= /conf/schemas", PKGDATADIR "/schemas= "); if (!schema || (virXMLValidateAgainstSchema(schema, xml) < 0)) diff --git a/tests/virschematest.c b/tests/virschematest.c index 4e657159e1..29a5546418 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -336,27 +336,29 @@ mymain(void) { int ret =3D 0; =20 +#define SCHEMAS_PATH "src/conf/schemas/" + #define DO_TEST(sch, ent) \ if (testSchemaEntries((sch), (ent), G_N_ELEMENTS(ent)) < 0) \ ret =3D -1; =20 - DO_TEST("docs/schemas/capability.rng", schemaCapability); - DO_TEST("docs/schemas/domain.rng", schemaDomain); - DO_TEST("docs/schemas/domaincaps.rng", schemaDomainCaps); - DO_TEST("docs/schemas/domainbackup.rng", schemaDomainBackup); - DO_TEST("docs/schemas/domaincheckpoint.rng", schemaDomainCheckpoint); - DO_TEST("docs/schemas/domainsnapshot.rng", schemaDomainSnapshot); - DO_TEST("docs/schemas/interface.rng", schemaInterface); - DO_TEST("docs/schemas/network.rng", schemaNetwork); - DO_TEST("docs/schemas/networkport.rng", schemaNetworkport); - DO_TEST("docs/schemas/nodedev.rng", schemaNodedev); - DO_TEST("docs/schemas/nwfilter.rng", schemaNwfilter); - DO_TEST("docs/schemas/nwfilterbinding.rng", schemaNwfilterbinding); - DO_TEST("docs/schemas/secret.rng", schemaSecret); - DO_TEST("docs/schemas/storagepoolcaps.rng", schemaStoragepoolcaps); - DO_TEST("docs/schemas/storagepool.rng", schemaStoragePool); - DO_TEST("docs/schemas/storagevol.rng", schemaStorageVol); - DO_TEST("docs/schemas/cpu.rng", schemaCpu); + DO_TEST(SCHEMAS_PATH "capability.rng", schemaCapability); + DO_TEST(SCHEMAS_PATH "domain.rng", schemaDomain); + DO_TEST(SCHEMAS_PATH "domaincaps.rng", schemaDomainCaps); + DO_TEST(SCHEMAS_PATH "domainbackup.rng", schemaDomainBackup); + DO_TEST(SCHEMAS_PATH "domaincheckpoint.rng", schemaDomainCheckpoint); + DO_TEST(SCHEMAS_PATH "domainsnapshot.rng", schemaDomainSnapshot); + DO_TEST(SCHEMAS_PATH "interface.rng", schemaInterface); + DO_TEST(SCHEMAS_PATH "network.rng", schemaNetwork); + DO_TEST(SCHEMAS_PATH "networkport.rng", schemaNetworkport); + DO_TEST(SCHEMAS_PATH "nodedev.rng", schemaNodedev); + DO_TEST(SCHEMAS_PATH "nwfilter.rng", schemaNwfilter); + DO_TEST(SCHEMAS_PATH "nwfilterbinding.rng", schemaNwfilterbinding); + DO_TEST(SCHEMAS_PATH "secret.rng", schemaSecret); + DO_TEST(SCHEMAS_PATH "storagepoolcaps.rng", schemaStoragepoolcaps); + DO_TEST(SCHEMAS_PATH "storagepool.rng", schemaStoragePool); + DO_TEST(SCHEMAS_PATH "storagevol.rng", schemaStorageVol); + DO_TEST(SCHEMAS_PATH "cpu.rng", schemaCpu); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.35.1