]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
rng: Add definition for network disk source
authorOsier Yang <jyang@redhat.com>
Wed, 3 Apr 2013 12:14:05 +0000 (20:14 +0800)
committerOsier Yang <jyang@redhat.com>
Wed, 3 Apr 2013 12:14:05 +0000 (20:14 +0800)
It's long enough to have a independant definition.

docs/schemas/domaincommon.rng

index 8d7e6db0d9ca15029ce0856a81c3469dc7221fe2..454ebdbaf9dbc282ac51085cb7dea32b3e6bdb20 100644 (file)
           <interleave>
             <optional>
               <element name="source">
-                <attribute name="protocol">
-                  <choice>
-                    <value>nbd</value>
-                    <value>rbd</value>
-                    <value>sheepdog</value>
-                    <value>gluster</value>
-                    <value>iscsi</value>
-                  </choice>
-                </attribute>
-                <optional>
-                  <attribute name="name"/>
-                </optional>
-                <zeroOrMore>
-                  <element name="host">
-                    <choice>
-                      <group>
-                        <optional>
-                          <attribute name="transport">
-                            <choice>
-                              <value>tcp</value>
-                              <value>rdma</value>
-                            </choice>
-                          </attribute>
-                        </optional>
-                        <attribute name="name">
-                          <choice>
-                            <ref name="dnsName"/>
-                            <ref name="ipAddr"/>
-                          </choice>
-                        </attribute>
-                        <optional>
-                          <attribute name="port">
-                            <ref name="unsignedInt"/>
-                          </attribute>
-                        </optional>
-                      </group>
-                      <group>
-                        <attribute name="transport">
-                          <value>unix</value>
-                        </attribute>
-                        <attribute name="socket">
-                          <ref name="absFilePath"/>
-                        </attribute>
-                      </group>
-                    </choice>
-                  </element>
-                </zeroOrMore>
-                <empty/>
+                <ref name='diskSourceNetwork'/>
               </element>
             </optional>
             <ref name="diskspec"/>
       </choice>
     </element>
   </define>
+  <define name="diskSourceNetwork">
+    <attribute name="protocol">
+      <choice>
+        <value>nbd</value>
+        <value>rbd</value>
+        <value>sheepdog</value>
+        <value>gluster</value>
+        <value>iscsi</value>
+      </choice>
+    </attribute>
+    <optional>
+      <attribute name="name"/>
+    </optional>
+    <zeroOrMore>
+      <element name="host">
+        <choice>
+          <group>
+            <optional>
+              <attribute name="transport">
+                <choice>
+                  <value>tcp</value>
+                  <value>rdma</value>
+                </choice>
+              </attribute>
+            </optional>
+            <attribute name="name">
+              <choice>
+                <ref name="dnsName"/>
+                <ref name="ipAddr"/>
+              </choice>
+            </attribute>
+            <optional>
+              <attribute name="port">
+                <ref name="unsignedInt"/>
+              </attribute>
+            </optional>
+          </group>
+          <group>
+            <attribute name="transport">
+              <value>unix</value>
+            </attribute>
+            <attribute name="socket">
+              <ref name="absFilePath"/>
+            </attribute>
+          </group>
+        </choice>
+      </element>
+    </zeroOrMore>
+    <empty/>
+  </define>
   <define name="diskTarget">
     <data type="string">
       <param name="pattern">(ioemu:)?(fd|hd|sd|vd|xvd|ubd)[a-zA-Z0-9_]+</param>