]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: don't add pci-bridge to Q35/arm domains unless it's needed
authorLaine Stump <laine@laine.org>
Fri, 22 Apr 2016 21:01:33 +0000 (17:01 -0400)
committerLaine Stump <laine@laine.org>
Thu, 16 Jun 2016 17:48:25 +0000 (13:48 -0400)
Until now, a Q35 domain (or arm/virt, or any other domain that has a
pcie-root bus) would always have a pci-bridge added, so that there
would be a hotpluggable standard PCI slot available to plug in any PCI
devices that might be added. This patch removes the explicit add,
instead relying on the pci-bridge being auto-added during PCI address
assignment (it will add a pci-bridge if there are no free slots).

This doesn't eliminate the dmi-to-pci-bridge controller that is
explicitly added whether or not a standard PCI slot is required (and
that is almost never used as anything other than a converter between
pcie.0's PCIe slots and standard PCI). That will be done separately.

src/qemu/qemu_domain.c
tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args
tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
tests/qemuxml2argvdata/qemuxml2argv-pcie-root.args
tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root.xml

index 8348460cf09bb937106b1fb56a8a03f05e6d570b..c844566d3435fc79b4d394e606e0aa7f210c24e3 100644 (file)
@@ -1959,10 +1959,6 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
             !virDomainDefAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 1,
                                       VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE))
             goto cleanup;
-        if (virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 2) < 0 &&
-            !virDomainDefAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 2,
-                                       VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE))
-            goto cleanup;
     }
 
     if (addDefaultMemballoon && !def->memballoon) {
index 1163245aee3f2931b142ada5c3e5a9ea8014974e..2a5702f8fae0250cb6dc6431e8233b3478c58dbc 100644 (file)
@@ -22,7 +22,6 @@ QEMU_AUDIO_DRV=none \
 -append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \
 -dtb /aarch64.dtb \
 -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
--device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
 -device virtio-serial-device,id=virtio-serial0 \
 -usb \
 -drive file=/aarch64.raw,format=raw,if=none,id=drive-virtio-disk0 \
index 9aaed4b70134217f59d03d10c4eca4fd13ea5602..a2df858f4276c88fb0fa4c4a501590b86679363a 100644 (file)
@@ -22,7 +22,6 @@ QEMU_AUDIO_DRV=none \
 -append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \
 -dtb /aarch64.dtb \
 -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
--device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
 -device virtio-serial-device,id=virtio-serial0 \
 -usb \
 -drive file=/aarch64.raw,format=raw,if=none,id=drive-virtio-disk0 \
index d6b139f3d7fc9fe5a745521fe473022d29405041..ade7acc141e66cd0d829c271c21ba65ac411d14a 100644 (file)
@@ -16,5 +16,4 @@ QEMU_AUDIO_DRV=none \
 -monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \
 -no-acpi \
 -boot c \
--device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
--device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0
+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e
index be2e113d2cf4651fb99a6209a6c256ac4e2a3ac8..a212601ec6743600e50c135b7ab1149d7a784141 100644 (file)
       <model name='i82801b11-bridge'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
     </controller>
-    <controller type='pci' index='2' model='pci-bridge'>
-      <model name='pci-bridge'/>
-      <target chassisNr='2'/>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
-    </controller>
     <controller type='virtio-serial' index='0'>
       <address type='virtio-mmio'/>
     </controller>
index 7f2e21a45561ed4b809a0ab281fa537d0c55b2d2..80dc35ea0db7d29403b0ee8cab5ffcd59bedbe03 100644 (file)
       <model name='i82801b11-bridge'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
     </controller>
-    <controller type='pci' index='2' model='pci-bridge'>
-      <model name='pci-bridge'/>
-      <target chassisNr='2'/>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
-    </controller>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
     <memballoon model='none'/>