]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Add aarch64-traditional-pci test
authorAndrea Bolognani <abologna@redhat.com>
Tue, 9 Jan 2018 17:42:51 +0000 (18:42 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 6 Apr 2018 12:12:11 +0000 (14:12 +0200)
This test shows what happens when you add a traditional PCI
device such as pci-serial to a pure PCIe machine type such
as aarch64/virt.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
tests/qemuxml2argvdata/aarch64-traditional-pci.args [new file with mode: 0644]
tests/qemuxml2argvdata/aarch64-traditional-pci.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/aarch64-traditional-pci.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c

diff --git a/tests/qemuxml2argvdata/aarch64-traditional-pci.args b/tests/qemuxml2argvdata/aarch64-traditional-pci.args
new file mode 100644 (file)
index 0000000..f10252f
--- /dev/null
@@ -0,0 +1,26 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-aarch64 \
+-name guest \
+-S \
+-M virt \
+-m 1024 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
+-nographic \
+-nodefconfig \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-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 pcie-root-port,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
+-chardev pty,id=charserial0 \
+-device pci-serial,chardev=charserial0,id=serial0,bus=pci.2,addr=0x1
diff --git a/tests/qemuxml2argvdata/aarch64-traditional-pci.xml b/tests/qemuxml2argvdata/aarch64-traditional-pci.xml
new file mode 100644 (file)
index 0000000..8c87a27
--- /dev/null
@@ -0,0 +1,19 @@
+<domain type="qemu">
+  <name>guest</name>
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
+  <memory>1048576</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch="aarch64" machine="virt">hvm</type>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <controller type='pci' model='pcie-root'/>
+    <!-- pci-serial is a traditional PCI device, and will cause a
+         traditional PCI topology to be created for the guest -->
+    <serial type='pty'>
+      <target type='pci-serial'/>
+    </serial>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index d79913dd0aac64125d4fddbc685d00152fab5eda..c58afcd6c2de5bd998ce4e055cb1c162498b66d4 100644 (file)
@@ -2748,6 +2748,14 @@ mymain(void)
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_PCIE_ROOT_PORT);
+    DO_TEST("aarch64-traditional-pci",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_OBJECT_GPEX,
+            QEMU_CAPS_PCI_MULTIFUNCTION,
+            QEMU_CAPS_DEVICE_PCIE_ROOT_PORT,
+            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
+            QEMU_CAPS_DEVICE_PCI_SERIAL);
 
     /* Make sure all combinations of ACPI and UEFI behave as expected */
     DO_TEST("aarch64-acpi-uefi", NONE);
diff --git a/tests/qemuxml2xmloutdata/aarch64-traditional-pci.xml b/tests/qemuxml2xmloutdata/aarch64-traditional-pci.xml
new file mode 100644 (file)
index 0000000..70664aa
--- /dev/null
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='aarch64' machine='virt'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <gic version='2'/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <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='0x00' function='0x0'/>
+    </controller>
+    <controller type='pci' index='3' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='3' port='0x10'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </controller>
+    <serial type='pty'>
+      <target type='pci-serial' port='0'>
+        <model name='pci-serial'/>
+      </target>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
+    </serial>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index 0f560290a0e364e80997e1b3992c2adb69958160..49b61d7647bd16fc290ce07d8ac3c245dc29dd15 100644 (file)
@@ -1117,6 +1117,14 @@ mymain(void)
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_PCIE_ROOT_PORT);
+    DO_TEST("aarch64-traditional-pci",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_OBJECT_GPEX,
+            QEMU_CAPS_PCI_MULTIFUNCTION,
+            QEMU_CAPS_DEVICE_PCIE_ROOT_PORT,
+            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
+            QEMU_CAPS_DEVICE_PCI_SERIAL);
     DO_TEST("aarch64-video-default",
             QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_OBJECT_GPEX,