]> xenbits.xensource.com Git - libvirt.git/commitdiff
Move capability formatting together
authorMartin Kletzander <mkletzan@redhat.com>
Sun, 3 Apr 2016 18:36:40 +0000 (20:36 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 2 May 2016 13:46:23 +0000 (15:46 +0200)
All sub-PCI capabilities should be next to each other for clarity.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
docs/schemas/nodedev.rng
src/conf/node_device_conf.c
tests/nodedevschemadata/pci_0000_00_1c_0_header_type.xml

index d9375130487c54bb4a896cfc70b9930b85228f66..6b9b54298b2175d79816d3393cbd6a5c6998662f 100644 (file)
       </element>
     </optional>
 
+    <optional>
+      <element name='capability'>
+        <attribute name='type'>
+          <choice>
+            <value>pci-bridge</value>
+            <value>cardbus-bridge</value>
+          </choice>
+        </attribute>
+      </element>
+    </optional>
+
     <optional>
       <element name='iommuGroup'>
         <attribute name='number'>
       </element>
     </optional>
 
-    <optional>
-      <element name='capability'>
-        <attribute name='type'>
-          <choice>
-            <value>pci-bridge</value>
-            <value>cardbus-bridge</value>
-          </choice>
-        </attribute>
-      </element>
-    </optional>
-
     <optional>
       <element name='pci-express'>
         <zeroOrMore>
index e7e4bbd390fa31555673918f4197fd5a565e116c..96ec6a0037147006bff9feb41ffc3cd21468004c 100644 (file)
@@ -383,6 +383,10 @@ char *virNodeDeviceDefFormat(const virNodeDeviceDef *def)
                     virBufferAddLit(&buf, "</capability>\n");
                 }
             }
+            if (data->pci_dev.hdrType) {
+                virBufferAsprintf(&buf, "<capability type='%s'/>\n",
+                                  virPCIHeaderTypeToString(data->pci_dev.hdrType));
+            }
             if (data->pci_dev.nIommuGroupDevices) {
                 virBufferAsprintf(&buf, "<iommuGroup number='%d'>\n",
                                   data->pci_dev.iommuGroupNumber);
@@ -403,11 +407,6 @@ char *virNodeDeviceDefFormat(const virNodeDeviceDef *def)
                 virBufferAsprintf(&buf, "<numa node='%d'/>\n",
                                   data->pci_dev.numa_node);
 
-            if (data->pci_dev.hdrType) {
-                virBufferAsprintf(&buf, "<capability type='%s'/>\n",
-                                  virPCIHeaderTypeToString(data->pci_dev.hdrType));
-            }
-
             if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCIE)
                 virPCIEDeviceInfoFormat(&buf, data->pci_dev.pci_express);
             break;
index dea5f05237ff249f76b1be42bc1f2d1a88c7acdd..c1be9f7d9cc0088f60a0451b3e22ebffb2dbfd86 100644 (file)
@@ -8,10 +8,10 @@
     <function>0</function>
     <product id='0x8c10'>8 Series/C220 Series Chipset Family PCI Express Root Port #1</product>
     <vendor id='0x8086'>Intel Corporation</vendor>
+    <capability type='pci-bridge'/>
     <iommuGroup number='8'>
       <address domain='0x0000' bus='0x00' slot='0x1c' function='0x0'/>
     </iommuGroup>
-    <capability type='pci-bridge'/>
     <pci-express>
       <link validity='cap' port='1' speed='5' width='1'/>
       <link validity='sta' speed='2.5' width='1'/>