[libvirt] [RFC PATCH auto partition NUMA guest domains v1 2/2] qemuxml2argv: add tests that exercise vNUMA auto partition topology

Wim Ten Have wim.ten.have at oracle.com
Tue Sep 25 10:02:42 UTC 2018


From: Wim ten Have <wim.ten.have at oracle.com>

Add tests to ensure that the virDomainNumaAutoconfig() routine to auto-
partition vNUMA topology generates correct KVM/QEMU cmdline arguments
under applicable <cpu mode="host-passthrough" check="numa"> setup.

Signed-off-by: Wim ten Have <wim.ten.have at oracle.com>
---
 .../cpu-host-passthrough-nonuma.args          | 25 ++++++++++++++++
 .../cpu-host-passthrough-nonuma.xml           | 18 ++++++++++++
 .../cpu-host-passthrough-numa.args            | 29 +++++++++++++++++++
 .../cpu-host-passthrough-numa.xml             | 18 ++++++++++++
 tests/qemuxml2argvtest.c                      |  2 ++
 5 files changed, 92 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.args
 create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.xml
 create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa.args
 create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa.xml

diff --git a/tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.args b/tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.args
new file mode 100644
index 000000000000..4599cdfcc159
--- /dev/null
+++ b/tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.args
@@ -0,0 +1,25 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=kvm,usb=off,dump-guest-core=off \
+-cpu host \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.xml b/tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.xml
new file mode 100644
index 000000000000..d8daa8c9a43a
--- /dev/null
+++ b/tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.xml
@@ -0,0 +1,18 @@
+<domain type='kvm'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+  </os>
+  <cpu mode='host-passthrough' check='numa'/>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/cpu-host-passthrough-numa.args b/tests/qemuxml2argvdata/cpu-host-passthrough-numa.args
new file mode 100644
index 000000000000..5b7b357cc0fe
--- /dev/null
+++ b/tests/qemuxml2argvdata/cpu-host-passthrough-numa.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=kvm,usb=off,dump-guest-core=off \
+-cpu host \
+-m 216 \
+-smp 6,sockets=6,cores=1,threads=1 \
+-numa node,nodeid=0,cpus=0,cpus=4,mem=54 \
+-numa node,nodeid=1,cpus=1,cpus=5,mem=54 \
+-numa node,nodeid=2,cpus=2,mem=54 \
+-numa node,nodeid=3,cpus=3,mem=54 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/cpu-host-passthrough-numa.xml b/tests/qemuxml2argvdata/cpu-host-passthrough-numa.xml
new file mode 100644
index 000000000000..39488521b27d
--- /dev/null
+++ b/tests/qemuxml2argvdata/cpu-host-passthrough-numa.xml
@@ -0,0 +1,18 @@
+<domain type='kvm'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>6</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+  </os>
+  <cpu mode='host-passthrough' check='numa'/>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index a7cde3ed7e74..4b6436b32ac7 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1745,6 +1745,8 @@ mymain(void)
                  FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE,
                  0, GIC_NONE, NONE);
     DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM);
+    DO_TEST("cpu-host-passthrough-numa", QEMU_CAPS_NUMA);
+    DO_TEST("cpu-host-passthrough-nonuma", QEMU_CAPS_NUMA);
     DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM);
 
     qemuTestSetHostArch(driver.caps, VIR_ARCH_S390X);
-- 
2.17.1




More information about the libvir-list mailing list