diff mbox

[1/2] qemu: aarch64: Don't add PCIe controller by default

Message ID 03d4606d7b9e75450457af074f3358a6afb54722.1454013286.git.crobinso@redhat.com
State New
Headers show

Commit Message

Cole Robinson Jan. 28, 2016, 9:14 p.m. UTC
This was discussed here:

https://www.redhat.com/archives/libvir-list/2015-December/msg00217.html

The summary is that apps/users are in a tough spot WRT aarch64 -M virt
and PCIe support: qemu has all the plumbing, but most distros don't
support it yet. Presently libvirt adds a PCIe controller to the XML for
new enough qemu, but this patch drops that behavior.

Upcoming patches will instead require users to manually specify a
pcie controller in the XML as a way of telling libvirt 'the OS supports
PCI', at which point libvirt can use it as a target for virtio-pci.
---
 src/qemu/qemu_domain.c                                         |  4 ----
 .../qemuxml2argv-aarch64-virtio-pci-default.args               |  2 --
 tests/qemuxml2argvtest.c                                       |  6 ++----
 .../qemuxml2xmlout-aarch64-virtio-pci-default.xml              | 10 ----------
 tests/qemuxml2xmltest.c                                        |  2 ++
 5 files changed, 4 insertions(+), 20 deletions(-)

-- 
2.5.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox

Patch

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1df1b74..aea1ea5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1109,10 +1109,6 @@  qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
     case VIR_ARCH_AARCH64:
         addDefaultUSB = false;
         addDefaultMemballoon = false;
-        if (STREQ(def->os.machine, "virt") ||
-            STRPREFIX(def->os.machine, "virt-")) {
-            addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
-        }
         break;
 
     case VIR_ARCH_PPC64:
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
index a49bc82..f879560 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
@@ -21,8 +21,6 @@  QEMU_AUDIO_DRV=none \
 -initrd /aarch64.initrd \
 -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=0x1 \
 -device virtio-serial-device,id=virtio-serial0 \
 -usb \
 -drive file=/aarch64.raw,format=raw,if=none,id=drive-virtio-disk0 \
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index cfb46ef..b2f636e 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1642,9 +1642,7 @@  mymain(void)
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
 
     /* Demonstrates the virtio-pci default... namely that there isn't any!
-       q35 style PCI controllers will be added if the binary supports it,
-       but virtio-mmio is always used unless PCI addresses are manually
-       specified. */
+       However this might change in the future... */
     DO_TEST("aarch64-virtio-pci-default",
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
             QEMU_CAPS_DEVICE_VIRTIO_MMIO,
@@ -1653,7 +1651,7 @@  mymain(void)
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE);
     /* Example of using virtio-pci with no explicit PCI controller
        but with manual PCI addresses */
-    DO_TEST("aarch64-virtio-pci-manual-addresses",
+    DO_TEST_PARSE_ERROR("aarch64-virtio-pci-manual-addresses",
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
             QEMU_CAPS_DEVICE_VIRTIO_MMIO,
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
index 6f1c53b..db2119c 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
@@ -31,16 +31,6 @@ 
       <target dev='vda' bus='virtio'/>
       <address type='virtio-mmio'/>
     </disk>
-    <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
-      <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='0x01' function='0x0'/>
-    </controller>
     <controller type='virtio-serial' index='0'>
       <address type='virtio-mmio'/>
     </controller>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 581129c..cac401c 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -731,12 +731,14 @@  mymain(void)
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
             QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI);
+    /*
     DO_TEST_FULL("aarch64-virtio-pci-manual-addresses", WHEN_ACTIVE,
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
             QEMU_CAPS_DEVICE_VIRTIO_MMIO,
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
             QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI);
+    */
     DO_TEST("aarch64-gic");
     DO_TEST("aarch64-gicv3");