[PATCH 4/7] schemas: Extract overrides for the domain element from 'domain.rng'

Peter Krempa posted 7 patches 3 years, 5 months ago
[PATCH 4/7] schemas: Extract overrides for the domain element from 'domain.rng'
Posted by Peter Krempa 3 years, 5 months ago
Move the overrides into a single file so that later patches can add
another top level element 'inactiveDomain' used in snapshots.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/conf/schemas/domain.rng          | 12 +-----------
 src/conf/schemas/domainoverrides.rng | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 11 deletions(-)
 create mode 100644 src/conf/schemas/domainoverrides.rng

diff --git a/src/conf/schemas/domain.rng b/src/conf/schemas/domain.rng
index b93bbed959..adc4386a27 100644
--- a/src/conf/schemas/domain.rng
+++ b/src/conf/schemas/domain.rng
@@ -6,16 +6,6 @@
     <ref name="domain"/>
   </start>

-  <include href="domaincommon.rng"/>
-
-  <define name="storageStartupPolicy" combine="choice">
-    <!-- overrides the no-op version in storagecommon.rng -->
-    <ref name="startupPolicy"/>
-  </define>
-
-  <define name="storageSourceExtra" combine="choice">
-    <!-- overrides the no-op version in storagecommon.rng -->
-    <ref name="diskspec"/>
-  </define>
+  <include href="domainoverrides.rng"/>

 </grammar>
diff --git a/src/conf/schemas/domainoverrides.rng b/src/conf/schemas/domainoverrides.rng
new file mode 100644
index 0000000000..13b18a28ea
--- /dev/null
+++ b/src/conf/schemas/domainoverrides.rng
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <!-- Overrides for the no-op versions of storage elements for use with domain XMLs. -->
+  <include href="domaincommon.rng"/>
+
+  <define name="storageStartupPolicy" combine="choice">
+    <!-- overrides the no-op version in storagecommon.rng -->
+    <ref name="startupPolicy"/>
+  </define>
+
+  <define name="storageSourceExtra" combine="choice">
+    <!-- overrides the no-op version in storagecommon.rng -->
+    <ref name="diskspec"/>
+  </define>
+
+</grammar>
-- 
2.37.1
Re: [PATCH 4/7] schemas: Extract overrides for the domain element from 'domain.rng'
Posted by Michal Prívozník 3 years, 5 months ago
On 8/25/22 11:46, Peter Krempa wrote:
> Move the overrides into a single file so that later patches can add
> another top level element 'inactiveDomain' used in snapshots.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/conf/schemas/domain.rng          | 12 +-----------
>  src/conf/schemas/domainoverrides.rng | 16 ++++++++++++++++
>  2 files changed, 17 insertions(+), 11 deletions(-)
>  create mode 100644 src/conf/schemas/domainoverrides.rng
> 

Don't forget to list this new file in meson.build:

diff --git i/src/conf/schemas/meson.build w/src/conf/schemas/meson.build
index 700161bf75..1bb09b4c5d 100644
--- i/src/conf/schemas/meson.build
+++ w/src/conf/schemas/meson.build
@@ -8,6 +8,7 @@ schema_files = [
   'domaincheckpoint.rng',
   'domaincommon.rng',
   'domain.rng',
+  'domainoverrides.rng',
   'domainsnapshot.rng',
   'interface.rng',
   'networkcommon.rng',

Michal