]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
schemas: move out of docs, fix no-docs build
authorClaudio Fontana <cfontana@suse.de>
Tue, 22 Mar 2022 08:18:57 +0000 (09:18 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 22 Mar 2022 10:05:09 +0000 (11:05 +0100)
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 <cfontana@suse.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
30 files changed:
docs/api_extension.rst
docs/meson.build
src/conf/cpu_conf.c
src/conf/meson.build
src/conf/schemas/basictypes.rng [moved from docs/schemas/basictypes.rng with 100% similarity]
src/conf/schemas/capability.rng [moved from docs/schemas/capability.rng with 100% similarity]
src/conf/schemas/cpu.rng [moved from docs/schemas/cpu.rng with 100% similarity]
src/conf/schemas/cputypes.rng [moved from docs/schemas/cputypes.rng with 100% similarity]
src/conf/schemas/domain.rng [moved from docs/schemas/domain.rng with 100% similarity]
src/conf/schemas/domainbackup.rng [moved from docs/schemas/domainbackup.rng with 100% similarity]
src/conf/schemas/domaincaps.rng [moved from docs/schemas/domaincaps.rng with 100% similarity]
src/conf/schemas/domaincheckpoint.rng [moved from docs/schemas/domaincheckpoint.rng with 100% similarity]
src/conf/schemas/domaincommon.rng [moved from docs/schemas/domaincommon.rng with 100% similarity]
src/conf/schemas/domainsnapshot.rng [moved from docs/schemas/domainsnapshot.rng with 100% similarity]
src/conf/schemas/interface.rng [moved from docs/schemas/interface.rng with 100% similarity]
src/conf/schemas/meson.build [moved from docs/schemas/meson.build with 83% similarity]
src/conf/schemas/network.rng [moved from docs/schemas/network.rng with 100% similarity]
src/conf/schemas/networkcommon.rng [moved from docs/schemas/networkcommon.rng with 100% similarity]
src/conf/schemas/networkport.rng [moved from docs/schemas/networkport.rng with 100% similarity]
src/conf/schemas/nodedev.rng [moved from docs/schemas/nodedev.rng with 100% similarity]
src/conf/schemas/nwfilter.rng [moved from docs/schemas/nwfilter.rng with 100% similarity]
src/conf/schemas/nwfilter_params.rng [moved from docs/schemas/nwfilter_params.rng with 100% similarity]
src/conf/schemas/nwfilterbinding.rng [moved from docs/schemas/nwfilterbinding.rng with 100% similarity]
src/conf/schemas/secret.rng [moved from docs/schemas/secret.rng with 100% similarity]
src/conf/schemas/storagecommon.rng [moved from docs/schemas/storagecommon.rng with 100% similarity]
src/conf/schemas/storagepool.rng [moved from docs/schemas/storagepool.rng with 100% similarity]
src/conf/schemas/storagepoolcaps.rng [moved from docs/schemas/storagepoolcaps.rng with 100% similarity]
src/conf/schemas/storagevol.rng [moved from docs/schemas/storagevol.rng with 100% similarity]
src/util/virxml.c
tests/virschematest.c

index 16d4b0a005ce3b432c5883fb13c6099efe31cf39..d70c244fd4d32dfa7281ac3f776a4e8b4cbd81e9 100644 (file)
@@ -73,7 +73,7 @@ The first task is to define the public API. If the new API involves an
 XML extension, you have to enhance the RelaxNG schema and document the
 new elements or attributes:
 
-``docs/schemas/domaincommon.rng         docs/formatdomain.html.in``
+``src/conf/schemas/domaincommon.rng         docs/formatdomain.html.in``
 
 If the API extension involves a new function, you have to add a
 declaration in the public header, and arrange to export the function
index 65cfde57dd308d58e2e320d8ea0ca0e687679834..b097866208f8112e6f2cba8690ccc4502bf4a436 100644 (file)
@@ -333,8 +333,6 @@ subdir('js')
 subdir('kbase')
 subdir('logos')
 subdir('manpages')
-subdir('schemas')
-
 
 foreach file : docs_assets
   # This hack enables us to view the web pages
index 819efcea8c3b37a3ffb4fcb78f3d7ed541dd75a4..2d447da7c3548e756f96902b8cd6a8e57795b4f0 100644 (file)
@@ -345,7 +345,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
         g_autofree char *schemafile = NULL;
 
         if (!(schemafile = virFileFindResource("cpu.rng",
-                                               abs_top_srcdir "/docs/schemas",
+                                               abs_top_srcdir "/src/conf/schemas",
                                                PKGDATADIR "/schemas")))
             return -1;
 
index bd35d87e0a70a03bfd60945c27c2ac9e39c6b0e2..82d265e975541d6f560bfbbacfb4163e4ce4af98 100644 (file)
@@ -111,3 +111,5 @@ virt_conf_lib = static_library(
 libvirt_libs += virt_conf_lib
 
 conf_inc_dir = include_directories('.')
+
+subdir('schemas')
similarity index 83%
rename from docs/schemas/meson.build
rename to src/conf/schemas/meson.build
index bb6a48787fd9e2705aaa27f2d7268e3341cccfbb..700161bf75bfa918bb922cb77fff2003fb29a1fb 100644 (file)
@@ -1,4 +1,4 @@
-docs_schema_files = [
+schema_files = [
   'basictypes.rng',
   'capability.rng',
   'cpu.rng',
@@ -24,4 +24,4 @@ docs_schema_files = [
   'storagevol.rng',
 ]
 
-install_data(docs_schema_files, install_dir: pkgdatadir / 'schemas')
+install_data(schema_files, install_dir: pkgdatadir / 'schemas')
index 268aad1d20ee125bd4a123c066a9f7ee91bbe144..8ff59e7cda5fdfb9b5853f7e87b69dfbf65f749c 100644 (file)
@@ -1099,7 +1099,7 @@ virXMLParseHelper(int domcode,
 
     if (validate && schemafile != NULL) {
         g_autofree char *schema = virFileFindResource(schemafile,
-                                                      abs_top_srcdir "/docs/schemas",
+                                                      abs_top_srcdir "/src/conf/schemas",
                                                       PKGDATADIR "/schemas");
         if (!schema ||
             (virXMLValidateAgainstSchema(schema, xml) < 0))
index 4e657159e1f77fec6a4e8bf9c25c40b6d3765eeb..29a5546418494d4d69b3bf73a8ff395258a888f2 100644 (file)
@@ -336,27 +336,29 @@ mymain(void)
 {
     int ret = 0;
 
+#define SCHEMAS_PATH "src/conf/schemas/"
+
 #define DO_TEST(sch, ent) \
     if (testSchemaEntries((sch), (ent), G_N_ELEMENTS(ent)) < 0) \
         ret = -1;
 
-    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);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }