]> xenbits.xensource.com Git - libvirt.git/commitdiff
schema: fix resolved interfaces of network type
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Wed, 20 Jul 2016 12:11:46 +0000 (15:11 +0300)
committerJán Tomko <jtomko@redhat.com>
Mon, 1 Aug 2016 09:30:51 +0000 (11:30 +0200)
  This patch reflects cases when <interface> element and its <source>
subelement for network type are formated based on actual type resolved
from referenced network instead of original one. networkAllocateActualDevice
and virDomainActualNetDefContentsFormat are taken as reference.

docs/schemas/domaincommon.rng
docs/schemas/network.rng
docs/schemas/networkcommon.rng

index eb781871e5f3640e5c70e6a303d03f029cb762e5..ac9fd21816ba55328b524f6fa98cf8e98cfe56df 100644 (file)
     </element>
   </define>
 
+  <define name="interface-network-attributes">
+    <attribute name="network">
+      <text/>
+    </attribute>
+    <optional>
+      <attribute name="portgroup">
+        <ref name="deviceName"/>
+      </attribute>
+    </optional>
+  </define>
+
+  <define name="interface-bridge-attributes">
+    <attribute name="bridge">
+      <ref name="deviceName"/>
+    </attribute>
+    <optional>
+      <attribute name="macTableManager">
+        <ref name="macTableManager"/>
+      </attribute>
+    </optional>
+  </define>
+
   <!--
       An interface description can either be of type bridge in which case
       it will use a bridging source, or of type ethernet which uses a device
           <interleave>
             <optional>
               <element name="source">
-                <attribute name="bridge">
-                  <ref name="deviceName"/>
-                </attribute>
+                <ref name="interface-bridge-attributes"/>
+                <optional>
+                  <ref name="interface-network-attributes"/>
+                </optional>
                 <empty/>
               </element>
             </optional>
           </attribute>
           <interleave>
             <element name="source">
-              <attribute name="network">
-                <text/>
-              </attribute>
+              <ref name='interface-network-attributes'/>
               <optional>
-                <attribute name="portgroup">
-                  <ref name="deviceName"/>
-                </attribute>
+                <ref name="interface-bridge-attributes"/>
               </optional>
               <empty/>
             </element>
                   <ref name="bridgeMode"/>
                 </attribute>
               </optional>
+              <optional>
+                <ref name='interface-network-attributes'/>
+              </optional>
               <empty/>
             </element>
             <optional>
index b67a5eae88701a094062efcdf3ac5b373b596c3f..c2c51aea4d4d5bb523c14755efe4d300a6025582 100644 (file)
 
             <optional>
               <attribute name="macTableManager">
-                <choice>
-                  <value>kernel</value>
-                  <value>libvirt</value>
-                </choice>
+                <ref name="macTableManager"/>
               </attribute>
             </optional>
 
index fb69f7c7120f8059fd8a36231c54fea4eca0a24a..a334b83e3b85efd78bdd354a0a91795cd1d51b29 100644 (file)
       </optional>
     </element>
   </define>
+  <define name="macTableManager">
+    <choice>
+      <value>kernel</value>
+      <value>libvirt</value>
+    </choice>
+  </define>
 </grammar>