[libvirt] [PATCH 6/6] conf: move <auth> and <encryption> to disk source

Eric Blake eblake at redhat.com
Sun Apr 13 02:27:09 UTC 2014


In a backing chain, each file of the chain can have a different
authorization or encryption; therefore, this information should
be associated with the common storage source elements.

* docs/schemas/domaincommon.rng (diskspec): Drop source-related
portions...
(disksource): ...and include common types here instead.
(diskAuth, diskAuthSecret): Move...
* docs/schemas/storagecommon.rng (diskAuth, diskAuthSecret):
...here.
(storageSourceCommon): New define.

Signed-off-by: Eric Blake <eblake at redhat.com>
---
 docs/schemas/domaincommon.rng  | 33 ----------------------------
 docs/schemas/storagecommon.rng | 50 +++++++++++++++++++++++++++++++++++++-----
 2 files changed, 45 insertions(+), 38 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 80b58e8..b302433 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1008,9 +1008,6 @@
       <optional>
         <ref name='diskMirror'/>
       </optional>
-      <optional>
-        <ref name="diskAuth"/>
-      </optional>
       <ref name="target"/>
       <optional>
         <ref name="deviceBoot"/>
@@ -1036,9 +1033,6 @@
         </element>
       </optional>
       <optional>
-        <ref name="encryption"/>
-      </optional>
-      <optional>
         <ref name="diskIoTune"/>
       </optional>
       <optional>
@@ -3974,33 +3968,6 @@
       </optional>
     </element>
   </define>
-  <define name="diskAuth">
-    <element name="auth">
-      <attribute name="username">
-        <ref name="genericName"/>
-      </attribute>
-      <ref name="diskAuthSecret"/>
-    </element>
-  </define>
-
-  <define name='diskAuthSecret'>
-    <element name='secret'>
-      <attribute name='type'>
-        <choice>
-          <value>ceph</value>
-          <value>iscsi</value>
-        </choice>
-      </attribute>
-      <choice>
-        <attribute name='uuid'>
-          <ref name="UUID"/>
-        </attribute>
-        <attribute name='usage'>
-          <ref name='genericName'/>
-        </attribute>
-      </choice>
-    </element>
-  </define>

   <define name='diskIoTune'>
     <element name="iotune">
diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng
index ef0f62f..5a4633a 100644
--- a/docs/schemas/storagecommon.rng
+++ b/docs/schemas/storagecommon.rng
@@ -6,6 +6,34 @@
   <!-- This schema is not designed for standalone use; another file
        must include both this file and basictypes.rng -->

+  <define name='diskAuthSecret'>
+    <element name='secret'>
+      <attribute name='type'>
+        <choice>
+          <value>ceph</value>
+          <value>iscsi</value>
+        </choice>
+      </attribute>
+      <choice>
+        <attribute name='uuid'>
+          <ref name="UUID"/>
+        </attribute>
+        <attribute name='usage'>
+          <ref name='genericName'/>
+        </attribute>
+      </choice>
+    </element>
+  </define>
+
+  <define name="diskAuth">
+    <element name="auth">
+      <attribute name="username">
+        <ref name="genericName"/>
+      </attribute>
+      <ref name="diskAuthSecret"/>
+    </element>
+  </define>
+
   <define name='encryption'>
     <element name='encryption'>
       <attribute name='format'>
@@ -102,6 +130,18 @@
     <notAllowed/>
   </define>

+  <define name='storageSourceCommon'>
+    <interleave>
+      <optional>
+        <ref name="encryption"/>
+      </optional>
+      <optional>
+        <ref name="diskAuth"/>
+      </optional>
+      <ref name='storageSourceExtra'/>
+    </interleave>
+  </define>
+
   <define name="storageSourceFile">
     <optional>
       <attribute name="type">
@@ -124,7 +164,7 @@
           </optional>
         </element>
       </optional>
-      <ref name='storageSourceExtra'/>
+      <ref name='storageSourceCommon'/>
     </interleave>
   </define>

@@ -148,7 +188,7 @@
           </optional>
         </element>
       </optional>
-      <ref name='storageSourceExtra'/>
+      <ref name='storageSourceCommon'/>
     </interleave>
   </define>

@@ -168,7 +208,7 @@
           <empty/>
         </element>
       </optional>
-      <ref name='storageSourceExtra'/>
+      <ref name='storageSourceCommon'/>
     </interleave>
   </define>

@@ -232,7 +272,7 @@
         </zeroOrMore>
         <empty/>
       </element>
-      <ref name='storageSourceExtra'/>
+      <ref name='storageSourceCommon'/>
     </interleave>
   </define>

@@ -265,7 +305,7 @@
           </optional>
         </element>
       </optional>
-      <ref name='storageSourceExtra'/>
+      <ref name='storageSourceCommon'/>
     </interleave>
   </define>

-- 
1.9.0




More information about the libvir-list mailing list