Because of v8.5.0-rc1~25 we are already faking TPM support for
domaincaps. Might as well fake supported TPM versions.
The swtpm binary supports both TPM versions since its first
release, but pretend it isn't the case. For QEMU-5.2 and older
pretend only TPM-1.2 is available, QEMU-6.* has both TPM-1.2 and
TPM-2.0 and QEMU-7.0 and newer has only TPM-2.0 available.
This way, domaincaps are more dispersed.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_3.1.0.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.0.0.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 3 +++
tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 3 +++
.../domaincapsdata/qemu_5.0.0-virt.aarch64.xml | 3 +++
tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 3 +++
tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 3 +++
tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 3 +++
.../domaincapsdata/qemu_5.2.0-virt.aarch64.xml | 3 +++
tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 3 +++
tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 3 +++
tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 4 ++++
tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 4 ++++
.../domaincapsdata/qemu_6.0.0-virt.aarch64.xml | 4 ++++
tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 4 ++++
tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 4 ++++
tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 4 ++++
tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 4 ++++
tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 4 ++++
tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 4 ++++
tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 4 ++++
.../domaincapsdata/qemu_6.2.0-virt.aarch64.xml | 4 ++++
tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 4 ++++
tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 4 ++++
tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 4 ++++
tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 3 +++
.../domaincapsdata/qemu_7.0.0-virt.aarch64.xml | 3 +++
tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 3 +++
tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 3 +++
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 3 +++
tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 3 +++
tests/domaincapstest.c | 17 ++++++++++++++++-
tests/testutilsqemu.c | 13 +++++++++++--
tests/testutilsqemu.h | 3 +++
54 files changed, 197 insertions(+), 3 deletions(-)
diff --git a/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml
index c4277c53a1..0cbfd675fa 100644
--- a/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml
@@ -198,6 +198,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml
index 2a65cb0ad9..823af73010 100644
--- a/tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml
@@ -217,6 +217,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_3.1.0.x86_64.xml
b/tests/domaincapsdata/qemu_3.1.0.x86_64.xml
index 6e3ddda356..0b1f60e89d 100644
--- a/tests/domaincapsdata/qemu_3.1.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_3.1.0.x86_64.xml
@@ -198,6 +198,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml
index 8f3911b4b3..4cfa127b7a 100644
--- a/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml
@@ -198,6 +198,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml
index a4dc7bafc9..06baee7f68 100644
--- a/tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml
@@ -217,6 +217,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.0.0.x86_64.xml
b/tests/domaincapsdata/qemu_4.0.0.x86_64.xml
index 24e732d9c3..6d6e9bbc3f 100644
--- a/tests/domaincapsdata/qemu_4.0.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.0.0.x86_64.xml
@@ -198,6 +198,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
index 3ee7feea48..1b598b6be1 100644
--- a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
@@ -204,6 +204,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
index b20c02cb68..ca07b7ae82 100644
--- a/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
@@ -220,6 +220,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
index 0f1d398e2c..11bf14708c 100644
--- a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
@@ -204,6 +204,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
index c8a77cdd41..0ec4c570ac 100644
--- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
@@ -212,6 +212,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
index d0ee3f7b7a..4e0cb08b72 100644
--- a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
@@ -227,6 +227,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml
b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml
index 4c3a2c6d98..e21ba9372b 100644
--- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml
@@ -132,6 +132,9 @@
<value>spapr-tpm-proxy</value>
</enum>
<enum name='backendModel'/>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
index 6578fd04b6..d8793bb38a 100644
--- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
@@ -212,6 +212,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
index 8a6797c2f1..036e446c64 100644
--- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
@@ -214,6 +214,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
index d277c96426..4df4e86cf1 100644
--- a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
@@ -229,6 +229,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml
b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml
index f8cea230d9..bb8500baa6 100644
--- a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml
@@ -173,6 +173,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml
b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml
index ab72b7ffeb..e7227d092f 100644
--- a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml
@@ -171,6 +171,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml
b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml
index d196676b14..cac329fd08 100644
--- a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml
@@ -138,6 +138,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
index 51ca1d98e0..e901d12918 100644
--- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
@@ -214,6 +214,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml
index 3468fb2e72..df1572c901 100644
--- a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml
@@ -215,6 +215,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml
index 4f1ffbb2ba..3a6dc7b5fc 100644
--- a/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml
@@ -229,6 +229,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml
b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml
index 8ff49c7899..e0e8e0ed12 100644
--- a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml
@@ -215,6 +215,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml
index 2301a475eb..6a49f568be 100644
--- a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml
@@ -215,6 +215,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml
index 6cff0f815e..f41f47c346 100644
--- a/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml
@@ -229,6 +229,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml
b/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml
index a863a6052d..dfd792c031 100644
--- a/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml
+++ b/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml
@@ -173,6 +173,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.2.0.aarch64.xml
b/tests/domaincapsdata/qemu_5.2.0.aarch64.xml
index ab72b7ffeb..e7227d092f 100644
--- a/tests/domaincapsdata/qemu_5.2.0.aarch64.xml
+++ b/tests/domaincapsdata/qemu_5.2.0.aarch64.xml
@@ -171,6 +171,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml
b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml
index b2c0577be9..88e4837ec3 100644
--- a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml
@@ -138,6 +138,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml
b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml
index 41a54985d7..0a6f72df7e 100644
--- a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml
@@ -215,6 +215,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml
index 4595e70f61..40df34edf0 100644
--- a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml
@@ -216,6 +216,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml
index 65f4459bcb..e563b0cb59 100644
--- a/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml
@@ -230,6 +230,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml
b/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml
index 61eab9de0e..958c40437f 100644
--- a/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml
+++ b/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml
@@ -174,6 +174,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.0.0.aarch64.xml
b/tests/domaincapsdata/qemu_6.0.0.aarch64.xml
index fa722b5fd3..4164bf49f7 100644
--- a/tests/domaincapsdata/qemu_6.0.0.aarch64.xml
+++ b/tests/domaincapsdata/qemu_6.0.0.aarch64.xml
@@ -172,6 +172,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml
b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml
index a6fa374211..eb60a2105f 100644
--- a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml
@@ -216,6 +216,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml
index f4d0fcf673..0480a086c6 100644
--- a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml
@@ -217,6 +217,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml
index 40bc875e3c..7baecb0c73 100644
--- a/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml
@@ -230,6 +230,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml
b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml
index 67fc449f5d..9cbe93ad46 100644
--- a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml
@@ -217,6 +217,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml
index 9d68c0a404..07b951b81f 100644
--- a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml
@@ -217,6 +217,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml
index a439dda190..367e656b31 100644
--- a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml
@@ -231,6 +231,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml
b/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml
index f6045623f5..99c0fc03fd 100644
--- a/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml
@@ -176,6 +176,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.2.0.aarch64.xml
b/tests/domaincapsdata/qemu_6.2.0.aarch64.xml
index 35e18adcd5..8e04508694 100644
--- a/tests/domaincapsdata/qemu_6.2.0.aarch64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0.aarch64.xml
@@ -174,6 +174,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml
b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml
index b07072778b..0bbe501383 100644
--- a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml
@@ -136,6 +136,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml
b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml
index 0f89790b60..f363cf1b79 100644
--- a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml
@@ -217,6 +217,10 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
index 4e6ff06125..136dadaeb4 100644
--- a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
@@ -219,6 +219,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
index ed80a7892f..c684759356 100644
--- a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
@@ -233,6 +233,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml
b/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml
index 7a8cb9f113..1d6f29db9f 100644
--- a/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml
@@ -176,6 +176,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.0.0.aarch64.xml
b/tests/domaincapsdata/qemu_7.0.0.aarch64.xml
index d48c87dc3a..73097470f8 100644
--- a/tests/domaincapsdata/qemu_7.0.0.aarch64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0.aarch64.xml
@@ -174,6 +174,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml
b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml
index ec171bcdd9..7765c941c5 100644
--- a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml
@@ -138,6 +138,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml
b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml
index a20395c6d4..0f9a65ef1b 100644
--- a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml
@@ -219,6 +219,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml
index 4e96c5104a..30082712f4 100644
--- a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml
@@ -218,6 +218,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml
index 46542c8b5b..bcca02f0a4 100644
--- a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml
@@ -231,6 +231,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml
b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml
index 02b43e318f..f377b8e3a9 100644
--- a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml
@@ -218,6 +218,9 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>2.0</value>
+ </enum>
</tpm>
</devices>
<features>
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 3b8216a8f6..b4cb1894c2 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -252,6 +252,7 @@ doTestQemuInternal(const char *version,
g_autofree char *name = NULL;
g_autofree char *capsName = NULL;
g_autofree char *emulator = NULL;
+ int rc;
name = g_strdup_printf("qemu_%s%s%s%s.%s",
version,
@@ -274,7 +275,21 @@ doTestQemuInternal(const char *version,
};
VIR_WARNINGS_RESET
- if (virTestRun(name, test_virDomainCapsFormat, &data) < 0)
+ if (STRPREFIX(version, "3.") ||
+ STRPREFIX(version, "4.") ||
+ STRPREFIX(version, "5.")) {
+ g_setenv(TEST_TPM_ENV_VAR, TPM_VER_1_2, true);
+ } else if (STRPREFIX(version, "6.")) {
+ g_setenv(TEST_TPM_ENV_VAR, TPM_VER_1_2 TPM_VER_2_0, true);
+ } else {
+ g_setenv(TEST_TPM_ENV_VAR, TPM_VER_2_0, true);
+ }
+
+ rc = virTestRun(name, test_virDomainCapsFormat, &data);
+
+ g_unsetenv(TEST_TPM_ENV_VAR);
+
+ if (rc < 0)
return -1;
return 0;
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 00dd9871d1..6d3decdc16 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -146,16 +146,25 @@ bool virTPMHasSwtpm(void)
}
+
bool
virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature cap)
{
+ const char *tpmver = getenv(TEST_TPM_ENV_VAR);
+
switch (cap) {
+ case VIR_TPM_SWTPM_SETUP_FEATURE_TPM_1_2:
+ if (!tpmver || (tpmver && strstr(tpmver, TPM_VER_1_2)))
+ return true;
+ break;
+ case VIR_TPM_SWTPM_SETUP_FEATURE_TPM_2_0:
+ if (!tpmver || (tpmver && strstr(tpmver, TPM_VER_2_0)))
+ return true;
+ break;
case VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_PWDFILE_FD:
case VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_CREATE_CONFIG_FILES:
case VIR_TPM_SWTPM_SETUP_FEATURE_TPM12_NOT_NEED_ROOT:
case VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_RECONFIGURE_PCR_BANKS:
- case VIR_TPM_SWTPM_SETUP_FEATURE_TPM_1_2:
- case VIR_TPM_SWTPM_SETUP_FEATURE_TPM_2_0:
case VIR_TPM_SWTPM_SETUP_FEATURE_LAST:
break;
}
diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h
index 7ce4c4ad8d..943958d02a 100644
--- a/tests/testutilsqemu.h
+++ b/tests/testutilsqemu.h
@@ -25,6 +25,9 @@
# include "qemu/qemu_conf.h"
# define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata"
+# define TEST_TPM_ENV_VAR "VIR_TEST_MOCK_FAKE_TPM_VERSION"
+# define TPM_VER_1_2 "1.2"
+# define TPM_VER_2_0 "2.0"
enum {
GIC_NONE = 0,
--
2.35.1