]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: re-situate <bandwidth> element in <interface>
authorLaine Stump <laine@laine.org>
Wed, 19 Feb 2014 14:22:48 +0000 (16:22 +0200)
committerLaine Stump <laine@laine.org>
Tue, 25 Feb 2014 14:03:05 +0000 (16:03 +0200)
This moves the call to virNetDevBandwidthFormat() in
virDomainNetDefFormat() to be called right after the call to
virNetDevVPortProfileFormat(), so that a single chunk of that function
can be placed inside an if that conditionally calls
virDomainActualNetDefContentsFormat() instead (next patch). The
re-ordering necessitates modifying a couple of test data files.

src/conf/domain_conf.c
tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml
tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml
tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml

index 3fc3bdf554b1139c5f7ba1b67c2110544a29ac83..fadcf8b0c2f18e88bda8cdbadb40e6c5223cf0db 100644 (file)
@@ -15599,6 +15599,9 @@ virDomainNetDefFormat(virBufferPtr buf,
         return -1;
     if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
         return -1;
+    if (virNetDevBandwidthFormat(def->bandwidth, buf) < 0)
+        return -1;
+
     virBufferEscapeString(buf, "<script path='%s'/>\n",
                           def->script);
     if (def->ifname &&
@@ -15651,9 +15654,6 @@ virDomainNetDefFormat(virBufferPtr buf,
                           virDomainNetInterfaceLinkStateTypeToString(def->linkstate));
     }
 
-    if (virNetDevBandwidthFormat(def->bandwidth, buf) < 0)
-        return -1;
-
     virBufferAdjustIndent(buf, -6);
 
     if (virDomainDeviceInfoFormat(buf, &def->info,
index a484e82341495a2ea6e6c095399b5fb31ef1a112..25fc120f637fe9115cc4778f7b68b732e7f0e378 100644 (file)
     <interface type='network'>
       <mac address='52:54:00:ea:35:6f'/>
       <source network='default'/>
-      <target dev='vnet0'/>
-      <model type='virtio'/>
       <bandwidth>
         <inbound average='4000' peak='8000' floor='200' burst='1024'/>
         <outbound average='4000' peak='8000' burst='1024'/>
       </bandwidth>
+      <target dev='vnet0'/>
+      <model type='virtio'/>
       <alias name='net0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
     </interface>
index 065ef2d73218ce6e9a02de3dcc5f64d7dff500a5..e5c45a3148a4b51b86f744e26539a6f365135b33 100644 (file)
     <interface type='network'>
       <mac address='52:54:00:ea:35:6f'/>
       <source network='default'/>
-      <target dev='vnet0'/>
-      <model type='virtio'/>
       <bandwidth>
         <inbound average='4000' peak='8000' floor='200' burst='1024'/>
         <outbound average='4000' peak='8000' burst='1024'/>
       </bandwidth>
+      <target dev='vnet0'/>
+      <model type='virtio'/>
       <alias name='net0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
     </interface>
index 064a05fa7b4ec61113b661c4a8598c9777ecbae0..f70e20a5ff10e87bd6759e2d1f5ec1588a241e3b 100644 (file)
     <interface type='network'>
       <mac address='52:54:00:24:a5:9f'/>
       <source network='default'/>
-      <model type='rtl8139'/>
       <bandwidth>
         <inbound average='1000' peak='4000' burst='1024'/>
         <outbound average='128' peak='256' burst='32768'/>
       </bandwidth>
+      <model type='rtl8139'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
     </interface>
     <serial type='pty'>