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