073345
From 7e23f06327869c9dad50ae98da10292356eb5f0f Mon Sep 17 00:00:00 2001
073345
Message-Id: <7e23f06327869c9dad50ae98da10292356eb5f0f@dist-git>
6d1f90
From: Jiri Denemark <jdenemar@redhat.com>
073345
Date: Fri, 15 Nov 2019 17:52:33 +0100
6d1f90
Subject: [PATCH] qemuxml2*test: Add tests for Icelake-Server, -pconfig
6d1f90
MIME-Version: 1.0
6d1f90
Content-Type: text/plain; charset=UTF-8
6d1f90
Content-Transfer-Encoding: 8bit
6d1f90
6d1f90
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6d1f90
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6d1f90
(cherry picked from commit ae793ecbcbd17b118ef3a876d247abb49574ab0e)
6d1f90
073345
https://bugzilla.redhat.com/show_bug.cgi?id=1749672
073345
https://bugzilla.redhat.com/show_bug.cgi?id=1756156
073345
https://bugzilla.redhat.com/show_bug.cgi?id=1721608
6d1f90
6d1f90
Conflicts:
6d1f90
	tests/qemuxml2argvtest.c
6d1f90
            - several new tests upstream
6d1f90
            - test case for QEMU 3.1.0 dropped; caps data are missing
6d1f90
              downstream and the case is not important here
6d1f90
6d1f90
	tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.x86_64-3.1.0.args
6d1f90
            - test case for QEMU 3.1.0 dropped; caps data are missing
6d1f90
              downstream and the case is not important here
6d1f90
6d1f90
	tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.x86_64-latest.args
6d1f90
            - downstream generates slightly different command line
6d1f90
6d1f90
	tests/qemuxml2xmloutdata/cpu-Icelake-Server-pconfig.x86_64-3.1.0.xml
6d1f90
	tests/qemuxml2xmloutdata/cpu-Icelake-Server-pconfig.x86_64-latest.xml
6d1f90
	tests/qemuxml2xmltest.c
6d1f90
            - missing DO_TEST_CAPS_* macros; the change to this test was
6d1f90
              dropped as it is not as important as the xml2argv test
6d1f90
6d1f90
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
073345
Message-Id: <8cbd8a44446d77a2699ca267b696cfbd05dc8bc3.1573836581.git.jdenemar@redhat.com>
6d1f90
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6d1f90
---
6d1f90
 ...-Icelake-Server-pconfig.x86_64-latest.args | 31 +++++++++++++++++++
6d1f90
 .../cpu-Icelake-Server-pconfig.xml            | 22 +++++++++++++
6d1f90
 tests/qemuxml2argvtest.c                      |  2 ++
6d1f90
 3 files changed, 55 insertions(+)
6d1f90
 create mode 100644 tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.x86_64-latest.args
6d1f90
 create mode 100644 tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.xml
6d1f90
6d1f90
diff --git a/tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.x86_64-latest.args
6d1f90
new file mode 100644
6d1f90
index 0000000000..664db44e7b
6d1f90
--- /dev/null
6d1f90
+++ b/tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.x86_64-latest.args
6d1f90
@@ -0,0 +1,31 @@
6d1f90
+LC_ALL=C \
6d1f90
+PATH=/bin \
6d1f90
+HOME=/home/test \
6d1f90
+USER=test \
6d1f90
+LOGNAME=test \
6d1f90
+QEMU_AUDIO_DRV=none \
6d1f90
+/usr/bin/qemu-system-x86_64 \
6d1f90
+-name guest=test,debug-threads=on \
6d1f90
+-S \
6d1f90
+-object secret,id=masterKey0,format=raw,\
6d1f90
+file=/tmp/lib/domain--1-test/master-key.aes \
6d1f90
+-machine pc,accel=kvm,usb=off,dump-guest-core=off \
6d1f90
+-cpu Icelake-Server,pconfig=off \
6d1f90
+-m 214 \
6d1f90
+-realtime mlock=off \
6d1f90
+-smp 1,sockets=1,cores=1,threads=1 \
6d1f90
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
6d1f90
+-display none \
6d1f90
+-no-user-config \
6d1f90
+-nodefaults \
6d1f90
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
6d1f90
+-mon chardev=charmonitor,id=monitor,mode=control \
6d1f90
+-rtc base=utc \
6d1f90
+-no-shutdown \
6d1f90
+-no-acpi \
6d1f90
+-boot strict=on \
6d1f90
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
6d1f90
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
6d1f90
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
6d1f90
+resourcecontrol=deny \
6d1f90
+-msg timestamp=on
6d1f90
diff --git a/tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.xml b/tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.xml
6d1f90
new file mode 100644
6d1f90
index 0000000000..ec64e1ee51
6d1f90
--- /dev/null
6d1f90
+++ b/tests/qemuxml2argvdata/cpu-Icelake-Server-pconfig.xml
6d1f90
@@ -0,0 +1,22 @@
6d1f90
+<domain type='kvm'>
6d1f90
+  <name>test</name>
6d1f90
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
6d1f90
+  <memory unit='KiB'>219100</memory>
6d1f90
+  <currentMemory unit='KiB'>219100</currentMemory>
6d1f90
+  <vcpu placement='static'>1</vcpu>
6d1f90
+  <os>
6d1f90
+    <type arch='x86_64' machine='pc'>hvm</type>
6d1f90
+    <boot dev='network'/>
6d1f90
+  </os>
6d1f90
+  <cpu mode='custom' match='exact' check='none'>
6d1f90
+    <model fallback='forbid'>Icelake-Server</model>
6d1f90
+    <feature name='pconfig' policy='disable'/>
6d1f90
+  </cpu>
6d1f90
+  <clock offset='utc'/>
6d1f90
+  <on_poweroff>destroy</on_poweroff>
6d1f90
+  <on_reboot>restart</on_reboot>
6d1f90
+  <on_crash>destroy</on_crash>
6d1f90
+  <devices>
6d1f90
+      <emulator>/usr/bin/qemu-system-x86_64</emulator>
6d1f90
+  </devices>
6d1f90
+</domain>
6d1f90
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
6d1f90
index 03d6a60736..5aff9b6e37 100644
6d1f90
--- a/tests/qemuxml2argvtest.c
6d1f90
+++ b/tests/qemuxml2argvtest.c
6d1f90
@@ -3000,6 +3000,8 @@ mymain(void)
6d1f90
 
6d1f90
     DO_TEST_CAPS_VER("launch-security-sev", "2.12.0");
6d1f90
 
6d1f90
+    DO_TEST_CAPS_LATEST("cpu-Icelake-Server-pconfig");
6d1f90
+
6d1f90
     if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL)
6d1f90
         virFileDeleteTree(fakerootdir);
6d1f90
 
6d1f90
-- 
6d1f90
2.24.0
6d1f90