[libvirt] [PATCH 1/5] rng: Drop useless <choice/>

Michal Privoznik mprivozn at redhat.com
Tue Sep 12 09:32:49 UTC 2017


If we have <choice/> with just one value to chose from, it's no
choice.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 docs/schemas/domaincommon.rng  | 72 +++++++++++-------------------------------
 docs/schemas/nodedev.rng       |  4 +--
 docs/schemas/storagecommon.rng |  4 +--
 3 files changed, 20 insertions(+), 60 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 06c5a91b3..a8e32014b 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1554,9 +1554,7 @@
     <element name="source">
       <interleave>
         <attribute name="protocol">
-          <choice>
-            <value>rbd</value>
-          </choice>
+          <value>rbd</value>
         </attribute>
         <optional>
           <attribute name="name"/>
@@ -1617,9 +1615,7 @@
   <define name="diskSourceNetworkProtocolNBD">
     <element name="source">
       <attribute name="protocol">
-        <choice>
-          <value>nbd</value>
-        </choice>
+        <value>nbd</value>
       </attribute>
       <optional>
         <attribute name="name"/>
@@ -1631,9 +1627,7 @@
   <define name="diskSourceNetworkProtocolGluster">
     <element name="source">
       <attribute name="protocol">
-        <choice>
-          <value>gluster</value>
-        </choice>
+        <value>gluster</value>
       </attribute>
       <attribute name="name"/>
       <oneOrMore>
@@ -2370,9 +2364,7 @@
           <interleave>
               <element name="source">
                 <attribute name="type">
-                  <choice>
-                    <value>unix</value>
-                  </choice>
+                  <value>unix</value>
                 </attribute>
                 <attribute name="path">
                   <ref name="absFilePath"/>
@@ -2475,9 +2467,7 @@
         </group>
         <group>
           <attribute name="type">
-            <choice>
-              <value>udp</value>
-            </choice>
+            <value>udp</value>
           </attribute>
           <interleave>
             <element name="source">
@@ -2967,9 +2957,7 @@
           </optional>
           <optional>
             <attribute name="connected">
-              <choice>
-                <value>keep</value>
-              </choice>
+              <value>keep</value>
             </attribute>
           </optional>
           <ref name="listenElements"/>
@@ -3693,9 +3681,7 @@
           </optional>
           <empty/>
         </group>
-        <choice>
-          <ref name="qemucdev"/>
-        </choice>
+        <ref name="qemucdev"/>
       </choice>
     </element>
   </define>
@@ -3730,9 +3716,7 @@
           <ref name="address"/>
         </optional>
         <zeroOrMore>
-          <choice>
-            <ref name="codec"/>
-          </choice>
+          <ref name="codec"/>
         </zeroOrMore>
       </interleave>
     </element>
@@ -3985,9 +3969,7 @@
     <element name="tpm">
       <optional>
         <attribute name="model">
-          <choice>
-            <value>tpm-tis</value>
-          </choice>
+          <value>tpm-tis</value>
         </attribute>
       </optional>
       <ref name="tpm-backend"/>
@@ -4106,9 +4088,7 @@
   <define name="hub">
     <element name="hub">
       <attribute name="type">
-        <choice>
-          <value>usb</value>
-        </choice>
+        <value>usb</value>
       </attribute>
       <optional>
         <ref name="alias"/>
@@ -4121,9 +4101,7 @@
   <define name="redirdev">
     <element name="redirdev">
       <attribute name="bus">
-        <choice>
-          <value>usb</value>
-        </choice>
+        <value>usb</value>
       </attribute>
       <attribute name="type">
         <ref name="qemucdevSrcTypeChoice"/>
@@ -4286,9 +4264,7 @@
         <group>  <!-- scsi_host adapter -->
           <optional>
             <attribute name="protocol">
-              <choice>
-                <value>adapter</value>   <!-- scsi_host, default, optional -->
-              </choice>
+              <value>adapter</value>   <!-- scsi_host, default, optional -->
             </attribute>
           </optional>
           <interleave>
@@ -4300,9 +4276,7 @@
         </group>
         <group>  <!-- iscsi adapter -->
           <attribute name="protocol">
-            <choice>
-              <value>iscsi</value>     <!-- iscsi, required -->
-            </choice>
+            <value>iscsi</value>     <!-- iscsi, required -->
           </attribute>
           <attribute name="name">
             <text/>
@@ -4338,9 +4312,7 @@
       <choice>
         <group>
           <attribute name="protocol">
-            <choice>
-              <value>vhost</value>     <!-- vhost, required -->
-            </choice>
+            <value>vhost</value>     <!-- vhost, required -->
           </attribute>
           <attribute name="wwpn">
             <data type="string">
@@ -4357,9 +4329,7 @@
       <value>mdev</value>
     </attribute>
     <attribute name="model">
-      <choice>
-        <value>vfio-pci</value>
-      </choice>
+      <value>vfio-pci</value>
     </attribute>
     <element name="source">
       <ref name="mdevaddress"/>
@@ -4821,9 +4791,7 @@
       <zeroOrMore>
         <element name="table">
           <attribute name="type">
-            <choice>
-              <value>slic</value>
-            </choice>
+            <value>slic</value>
           </attribute>
           <ref name="absFilePath"/>
         </element>
@@ -5035,9 +5003,7 @@
   <define name="rng">
     <element name="rng">
       <attribute name="model">
-        <choice>
-          <value>virtio</value>
-        </choice>
+        <value>virtio</value>
       </attribute>
       <interleave>
         <ref name="rng-backend"/>
@@ -5162,9 +5128,7 @@
           </optional>
           <optional>
             <attribute name='job'>
-              <choice>
-                <value>copy</value>
-              </choice>
+              <value>copy</value>
             </attribute>
           </optional>
           <optional>
diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng
index 5bcf31787..2704eeb25 100644
--- a/docs/schemas/nodedev.rng
+++ b/docs/schemas/nodedev.rng
@@ -220,9 +220,7 @@
               <element name='name'><text/></element>
             </optional>
             <element name='deviceAPI'>
-              <choice>
-                <value>vfio-pci</value>
-              </choice>
+              <value>vfio-pci</value>
             </element>
             <element name='availableInstances'>
               <ref name='unsignedInt'/>
diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng
index 316fbaee3..717f3c603 100644
--- a/docs/schemas/storagecommon.rng
+++ b/docs/schemas/storagecommon.rng
@@ -34,9 +34,7 @@
   <define name='secret'>
     <element name='secret'>
       <attribute name='type'>
-        <choice>
-          <value>passphrase</value>
-        </choice>
+        <value>passphrase</value>
       </attribute>
       <choice>
         <attribute name='uuid'>
-- 
2.13.5




More information about the libvir-list mailing list