[PATCH 08/12] qemucapabilitiestest: Test all capabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Enhance the test to cover all capabilities we probe for rather than
testing the flags only.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 .../domaincaps-qemu_1.6.50-1.xml                   |  1 +
 .../qemucapabilitiesdata/caps_1.2.2-1.x86_64.caps  | 42 ++++++++++++++
 .../qemucapabilitiesdata/caps_1.3.1-1.x86_64.caps  | 46 +++++++++++++++
 .../qemucapabilitiesdata/caps_1.4.2-1.x86_64.caps  | 47 ++++++++++++++++
 .../qemucapabilitiesdata/caps_1.5.3-1.x86_64.caps  | 47 ++++++++++++++++
 .../qemucapabilitiesdata/caps_1.6.0-1.x86_64.caps  | 51 +++++++++++++++++
 .../qemucapabilitiesdata/caps_1.6.50-1.x86_64.caps | 53 ++++++++++++++++++
 .../qemucapabilitiesdata/caps_2.1.1-1.x86_64.caps  | 58 +++++++++++++++++++
 .../qemucapabilitiesdata/caps_2.4.0-1.x86_64.caps  | 65 ++++++++++++++++++++++
 .../qemucapabilitiesdata/caps_2.5.0-1.x86_64.caps  | 65 ++++++++++++++++++++++
 .../qemucapabilitiesdata/caps_2.6.0-1.x86_64.caps  | 65 ++++++++++++++++++++++
 tests/qemucapabilitiestest.c                       | 30 ++++++----
 tests/testutilsqemu.c                              | 41 ++------------
 13 files changed, 564 insertions(+), 47 deletions(-)

diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
index 990661b..32f981d 100644
--- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
+++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
@@ -3,6 +3,7 @@
   <domain>kvm</domain>
   <machine>pc-1.2</machine>
   <arch>x86_64</arch>
+  <vcpu max='255'/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.x86_64.caps
index 4fdb88b..257a123 100644
--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -114,4 +118,42 @@
   <flag name='qxl.vram64_size_mb'/>
   <flag name='qxl-vga.vram64_size_mb'/>
   <flag name='device-tray-moved-event'/>
+  <version>1002002</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='qemu64'/>
+  <cpu name='phenom'/>
+  <cpu name='core2duo'/>
+  <cpu name='kvm64'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm32'/>
+  <cpu name='coreduo'/>
+  <cpu name='486'/>
+  <cpu name='pentium'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium3'/>
+  <cpu name='athlon'/>
+  <cpu name='n270'/>
+  <cpu name='Conroe'/>
+  <cpu name='Penryn'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Westmere'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G4'/>
+  <machine name='pc-1.2' alias='pc' maxCpus='0'/>
+  <machine name='xenpv' maxCpus='0'/>
+  <machine name='xenfv' maxCpus='0'/>
+  <machine name='isapc' maxCpus='0'/>
+  <machine name='pc-0.10' maxCpus='0'/>
+  <machine name='pc-0.11' maxCpus='0'/>
+  <machine name='pc-0.12' maxCpus='0'/>
+  <machine name='pc-0.13' maxCpus='0'/>
+  <machine name='pc-0.14' maxCpus='0'/>
+  <machine name='pc-0.15' maxCpus='0'/>
+  <machine name='pc-1.0' maxCpus='0'/>
+  <machine name='pc-1.1' maxCpus='0'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.x86_64.caps
index 6aac9c7..6f6a5b9 100644
--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -130,4 +134,46 @@
   <flag name='qxl-vga.vram64_size_mb'/>
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
+  <version>1003001</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='qemu64'/>
+  <cpu name='phenom'/>
+  <cpu name='core2duo'/>
+  <cpu name='kvm64'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm32'/>
+  <cpu name='coreduo'/>
+  <cpu name='486'/>
+  <cpu name='pentium'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium3'/>
+  <cpu name='athlon'/>
+  <cpu name='n270'/>
+  <cpu name='Conroe'/>
+  <cpu name='Penryn'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Westmere'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Haswell'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G5'/>
+  <machine name='pc-1.3' alias='pc' maxCpus='0'/>
+  <machine name='xenpv' maxCpus='0'/>
+  <machine name='q35-next' alias='q35' maxCpus='0'/>
+  <machine name='xenfv' maxCpus='0'/>
+  <machine name='isapc' maxCpus='0'/>
+  <machine name='pc-0.10' maxCpus='0'/>
+  <machine name='pc-0.11' maxCpus='0'/>
+  <machine name='pc-0.12' maxCpus='0'/>
+  <machine name='pc-0.13' maxCpus='0'/>
+  <machine name='pc-0.14' maxCpus='0'/>
+  <machine name='pc-0.15' maxCpus='0'/>
+  <machine name='pc-1.0' maxCpus='0'/>
+  <machine name='pc-1.1' maxCpus='0'/>
+  <machine name='pc-1.2' maxCpus='0'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.x86_64.caps
index b3440b5..18550e2 100644
--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -131,4 +135,47 @@
   <flag name='qxl-vga.vram64_size_mb'/>
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
+  <version>1004002</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='Opteron_G5'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Haswell'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Westmere'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Penryn'/>
+  <cpu name='Conroe'/>
+  <cpu name='n270'/>
+  <cpu name='athlon'/>
+  <cpu name='pentium3'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium'/>
+  <cpu name='486'/>
+  <cpu name='coreduo'/>
+  <cpu name='kvm32'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm64'/>
+  <cpu name='core2duo'/>
+  <cpu name='phenom'/>
+  <cpu name='qemu64'/>
+  <machine name='pc-i440fx-1.4' alias='pc' maxCpus='0'/>
+  <machine name='xenpv' maxCpus='0'/>
+  <machine name='pc-q35-1.4' alias='q35' maxCpus='0'/>
+  <machine name='xenfv' maxCpus='0'/>
+  <machine name='isapc' maxCpus='0'/>
+  <machine name='pc-0.10' maxCpus='0'/>
+  <machine name='pc-0.11' maxCpus='0'/>
+  <machine name='pc-0.12' maxCpus='0'/>
+  <machine name='pc-0.13' maxCpus='0'/>
+  <machine name='pc-0.14' maxCpus='0'/>
+  <machine name='pc-0.15' maxCpus='0'/>
+  <machine name='pc-1.0' maxCpus='0'/>
+  <machine name='pc-1.1' maxCpus='0'/>
+  <machine name='pc-1.2' maxCpus='0'/>
+  <machine name='pc-1.3' maxCpus='0'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.x86_64.caps
index 69f1ae0..72f09f7 100644
--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -140,4 +144,47 @@
   <flag name='qxl-vga.vram64_size_mb'/>
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
+  <version>1005003</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='Opteron_G5'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Haswell'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Westmere'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Penryn'/>
+  <cpu name='Conroe'/>
+  <cpu name='n270'/>
+  <cpu name='athlon'/>
+  <cpu name='pentium3'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium'/>
+  <cpu name='486'/>
+  <cpu name='coreduo'/>
+  <cpu name='kvm32'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm64'/>
+  <cpu name='core2duo'/>
+  <cpu name='phenom'/>
+  <cpu name='qemu64'/>
+  <machine name='pc-i440fx-1.5' alias='pc' maxCpus='255'/>
+  <machine name='pc-q35-1.4' maxCpus='255'/>
+  <machine name='pc-q35-1.5' alias='q35' maxCpus='255'/>
+  <machine name='isapc' maxCpus='1'/>
+  <machine name='pc-0.10' maxCpus='255'/>
+  <machine name='pc-0.11' maxCpus='255'/>
+  <machine name='pc-0.12' maxCpus='255'/>
+  <machine name='pc-0.13' maxCpus='255'/>
+  <machine name='pc-0.14' maxCpus='255'/>
+  <machine name='pc-0.15' maxCpus='255'/>
+  <machine name='pc-1.0' maxCpus='255'/>
+  <machine name='pc-1.1' maxCpus='255'/>
+  <machine name='pc-1.2' maxCpus='255'/>
+  <machine name='pc-1.3' maxCpus='255'/>
+  <machine name='pc-i440fx-1.4' maxCpus='255'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.x86_64.caps
index 90ea076..c612c11 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -146,4 +150,51 @@
   <flag name='qxl-vga.vram64_size_mb'/>
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
+  <version>1006000</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='Opteron_G5'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Haswell'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Westmere'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Penryn'/>
+  <cpu name='Conroe'/>
+  <cpu name='n270'/>
+  <cpu name='athlon'/>
+  <cpu name='pentium3'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium'/>
+  <cpu name='486'/>
+  <cpu name='coreduo'/>
+  <cpu name='kvm32'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm64'/>
+  <cpu name='core2duo'/>
+  <cpu name='phenom'/>
+  <cpu name='qemu64'/>
+  <machine name='pc-i440fx-1.6' alias='pc' maxCpus='255'/>
+  <machine name='xenpv' maxCpus='1'/>
+  <machine name='pc-q35-1.4' maxCpus='255'/>
+  <machine name='pc-q35-1.5' maxCpus='255'/>
+  <machine name='pc-q35-1.6' alias='q35' maxCpus='255'/>
+  <machine name='xenfv' maxCpus='128'/>
+  <machine name='isapc' maxCpus='1'/>
+  <machine name='pc-0.10' maxCpus='255'/>
+  <machine name='pc-0.11' maxCpus='255'/>
+  <machine name='pc-0.12' maxCpus='255'/>
+  <machine name='pc-0.13' maxCpus='255'/>
+  <machine name='pc-0.14' maxCpus='255'/>
+  <machine name='pc-0.15' maxCpus='255'/>
+  <machine name='pc-1.0' maxCpus='255'/>
+  <machine name='pc-1.1' maxCpus='255'/>
+  <machine name='pc-1.2' maxCpus='255'/>
+  <machine name='pc-1.3' maxCpus='255'/>
+  <machine name='pc-i440fx-1.4' maxCpus='255'/>
+  <machine name='pc-i440fx-1.5' maxCpus='255'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.x86_64.caps
index 8fcdae2..f4603c1 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -146,4 +150,53 @@
   <flag name='qxl-vga.vram64_size_mb'/>
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
+  <version>1006050</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='Opteron_G5'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Haswell'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Westmere'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Penryn'/>
+  <cpu name='Conroe'/>
+  <cpu name='n270'/>
+  <cpu name='athlon'/>
+  <cpu name='pentium3'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium'/>
+  <cpu name='486'/>
+  <cpu name='coreduo'/>
+  <cpu name='kvm32'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm64'/>
+  <cpu name='core2duo'/>
+  <cpu name='phenom'/>
+  <cpu name='qemu64'/>
+  <machine name='pc-i440fx-1.7' alias='pc' maxCpus='255'/>
+  <machine name='xenpv' maxCpus='1'/>
+  <machine name='pc-q35-1.4' maxCpus='255'/>
+  <machine name='pc-q35-1.5' maxCpus='255'/>
+  <machine name='pc-q35-1.6' maxCpus='255'/>
+  <machine name='pc-q35-1.7' alias='q35' maxCpus='255'/>
+  <machine name='xenfv' maxCpus='128'/>
+  <machine name='isapc' maxCpus='1'/>
+  <machine name='pc-0.10' maxCpus='255'/>
+  <machine name='pc-0.11' maxCpus='255'/>
+  <machine name='pc-0.12' maxCpus='255'/>
+  <machine name='pc-0.13' maxCpus='255'/>
+  <machine name='pc-0.14' maxCpus='255'/>
+  <machine name='pc-0.15' maxCpus='255'/>
+  <machine name='pc-1.0' maxCpus='255'/>
+  <machine name='pc-1.1' maxCpus='255'/>
+  <machine name='pc-1.2' maxCpus='255'/>
+  <machine name='pc-1.3' maxCpus='255'/>
+  <machine name='pc-i440fx-1.4' maxCpus='255'/>
+  <machine name='pc-i440fx-1.5' maxCpus='255'/>
+  <machine name='pc-i440fx-1.6' maxCpus='255'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.caps
index ac5d29f..4663e19 100644
--- a/tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -164,4 +168,58 @@
   <flag name='debug-threads'/>
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
+  <version>2001001</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='Opteron_G5'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Broadwell'/>
+  <cpu name='Haswell'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Westmere'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Penryn'/>
+  <cpu name='Conroe'/>
+  <cpu name='n270'/>
+  <cpu name='athlon'/>
+  <cpu name='pentium3'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium'/>
+  <cpu name='486'/>
+  <cpu name='coreduo'/>
+  <cpu name='kvm32'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm64'/>
+  <cpu name='core2duo'/>
+  <cpu name='phenom'/>
+  <cpu name='qemu64'/>
+  <machine name='pc-i440fx-2.1' alias='pc' maxCpus='255'/>
+  <machine name='pc-1.3' maxCpus='255'/>
+  <machine name='pc-0.12' maxCpus='255'/>
+  <machine name='pc-q35-1.6' maxCpus='255'/>
+  <machine name='pc-q35-1.5' maxCpus='255'/>
+  <machine name='xenpv' maxCpus='1'/>
+  <machine name='pc-i440fx-1.6' maxCpus='255'/>
+  <machine name='pc-i440fx-1.7' maxCpus='255'/>
+  <machine name='pc-q35-2.1' alias='q35' maxCpus='255'/>
+  <machine name='pc-0.11' maxCpus='255'/>
+  <machine name='pc-0.10' maxCpus='255'/>
+  <machine name='pc-1.2' maxCpus='255'/>
+  <machine name='isapc' maxCpus='1'/>
+  <machine name='pc-q35-1.4' maxCpus='255'/>
+  <machine name='xenfv' maxCpus='128'/>
+  <machine name='pc-0.15' maxCpus='255'/>
+  <machine name='pc-i440fx-1.5' maxCpus='255'/>
+  <machine name='pc-i440fx-1.4' maxCpus='255'/>
+  <machine name='pc-q35-2.0' maxCpus='255'/>
+  <machine name='pc-0.14' maxCpus='255'/>
+  <machine name='pc-1.1' maxCpus='255'/>
+  <machine name='pc-q35-1.7' maxCpus='255'/>
+  <machine name='pc-1.0' maxCpus='255'/>
+  <machine name='pc-i440fx-2.0' maxCpus='255'/>
+  <machine name='pc-0.13' maxCpus='255'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.caps
index 249a507..a8df7e1 100644
--- a/tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -177,4 +181,65 @@
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
   <flag name='virtio-scsi-pci.iothread'/>
+  <version>2004000</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='Opteron_G5'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Broadwell'/>
+  <cpu name='Broadwell-noTSX'/>
+  <cpu name='Haswell'/>
+  <cpu name='Haswell-noTSX'/>
+  <cpu name='IvyBridge'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Westmere'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Penryn'/>
+  <cpu name='Conroe'/>
+  <cpu name='n270'/>
+  <cpu name='athlon'/>
+  <cpu name='pentium3'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium'/>
+  <cpu name='486'/>
+  <cpu name='coreduo'/>
+  <cpu name='kvm32'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm64'/>
+  <cpu name='core2duo'/>
+  <cpu name='phenom'/>
+  <cpu name='qemu64'/>
+  <machine name='pc-i440fx-2.4' alias='pc' maxCpus='255'/>
+  <machine name='pc-1.3' maxCpus='255'/>
+  <machine name='pc-0.12' maxCpus='255'/>
+  <machine name='pc-q35-1.6' maxCpus='255'/>
+  <machine name='pc-q35-1.5' maxCpus='255'/>
+  <machine name='pc-i440fx-1.6' maxCpus='255'/>
+  <machine name='pc-q35-2.2' maxCpus='255'/>
+  <machine name='pc-i440fx-1.7' maxCpus='255'/>
+  <machine name='pc-q35-2.1' maxCpus='255'/>
+  <machine name='pc-0.11' maxCpus='255'/>
+  <machine name='pc-0.10' maxCpus='255'/>
+  <machine name='pc-i440fx-2.2' maxCpus='255'/>
+  <machine name='pc-1.2' maxCpus='255'/>
+  <machine name='isapc' maxCpus='1'/>
+  <machine name='pc-i440fx-2.3' maxCpus='255'/>
+  <machine name='pc-q35-1.4' maxCpus='255'/>
+  <machine name='pc-0.15' maxCpus='255'/>
+  <machine name='pc-i440fx-1.5' maxCpus='255'/>
+  <machine name='pc-q35-2.0' maxCpus='255'/>
+  <machine name='pc-i440fx-1.4' maxCpus='255'/>
+  <machine name='pc-0.14' maxCpus='255'/>
+  <machine name='pc-1.1' maxCpus='255'/>
+  <machine name='pc-i440fx-2.1' maxCpus='255'/>
+  <machine name='pc-q35-1.7' maxCpus='255'/>
+  <machine name='pc-1.0' maxCpus='255'/>
+  <machine name='pc-i440fx-2.0' maxCpus='255'/>
+  <machine name='pc-q35-2.4' alias='q35' maxCpus='255'/>
+  <machine name='pc-q35-2.3' maxCpus='255'/>
+  <machine name='pc-0.13' maxCpus='255'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.caps
index 9b30bbb..2160173 100644
--- a/tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -178,4 +182,65 @@
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
   <flag name='virtio-scsi-pci.iothread'/>
+  <version>2004000</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='Opteron_G5'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Broadwell'/>
+  <cpu name='Broadwell-noTSX'/>
+  <cpu name='Haswell'/>
+  <cpu name='Haswell-noTSX'/>
+  <cpu name='IvyBridge'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Westmere'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Penryn'/>
+  <cpu name='Conroe'/>
+  <cpu name='n270'/>
+  <cpu name='athlon'/>
+  <cpu name='pentium3'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium'/>
+  <cpu name='486'/>
+  <cpu name='coreduo'/>
+  <cpu name='kvm32'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm64'/>
+  <cpu name='core2duo'/>
+  <cpu name='phenom'/>
+  <cpu name='qemu64'/>
+  <machine name='pc-i440fx-2.4' alias='pc' maxCpus='255'/>
+  <machine name='pc-1.3' maxCpus='255'/>
+  <machine name='pc-0.12' maxCpus='255'/>
+  <machine name='pc-q35-1.6' maxCpus='255'/>
+  <machine name='pc-q35-1.5' maxCpus='255'/>
+  <machine name='pc-i440fx-1.6' maxCpus='255'/>
+  <machine name='pc-q35-2.2' maxCpus='255'/>
+  <machine name='pc-i440fx-1.7' maxCpus='255'/>
+  <machine name='pc-q35-2.1' maxCpus='255'/>
+  <machine name='pc-0.11' maxCpus='255'/>
+  <machine name='pc-0.10' maxCpus='255'/>
+  <machine name='pc-i440fx-2.2' maxCpus='255'/>
+  <machine name='pc-1.2' maxCpus='255'/>
+  <machine name='isapc' maxCpus='1'/>
+  <machine name='pc-i440fx-2.3' maxCpus='255'/>
+  <machine name='pc-q35-1.4' maxCpus='255'/>
+  <machine name='pc-0.15' maxCpus='255'/>
+  <machine name='pc-i440fx-1.5' maxCpus='255'/>
+  <machine name='pc-q35-2.0' maxCpus='255'/>
+  <machine name='pc-i440fx-1.4' maxCpus='255'/>
+  <machine name='pc-0.14' maxCpus='255'/>
+  <machine name='pc-1.1' maxCpus='255'/>
+  <machine name='pc-i440fx-2.1' maxCpus='255'/>
+  <machine name='pc-q35-1.7' maxCpus='255'/>
+  <machine name='pc-1.0' maxCpus='255'/>
+  <machine name='pc-i440fx-2.0' maxCpus='255'/>
+  <machine name='pc-q35-2.4' alias='q35' maxCpus='255'/>
+  <machine name='pc-q35-2.3' maxCpus='255'/>
+  <machine name='pc-0.13' maxCpus='255'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.caps b/tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.caps
index 905144a..9024d63 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.caps
+++ b/tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.caps
@@ -1,4 +1,8 @@
 <qemuCaps>
+  <qemuctime>0</qemuctime>
+  <selfctime>0</selfctime>
+  <selfvers>0</selfvers>
+  <usedQMP/>
   <flag name='mem-path'/>
   <flag name='drive-serial'/>
   <flag name='chardev'/>
@@ -183,4 +187,65 @@
   <flag name='device-tray-moved-event'/>
   <flag name='nec-usb-xhci-ports'/>
   <flag name='virtio-scsi-pci.iothread'/>
+  <version>2005050</version>
+  <kvmVersion>0</kvmVersion>
+  <package></package>
+  <arch>x86_64</arch>
+  <cpu name='Opteron_G5'/>
+  <cpu name='Opteron_G4'/>
+  <cpu name='Opteron_G3'/>
+  <cpu name='Opteron_G2'/>
+  <cpu name='Opteron_G1'/>
+  <cpu name='Broadwell'/>
+  <cpu name='Broadwell-noTSX'/>
+  <cpu name='Haswell'/>
+  <cpu name='Haswell-noTSX'/>
+  <cpu name='IvyBridge'/>
+  <cpu name='SandyBridge'/>
+  <cpu name='Westmere'/>
+  <cpu name='Nehalem'/>
+  <cpu name='Penryn'/>
+  <cpu name='Conroe'/>
+  <cpu name='n270'/>
+  <cpu name='athlon'/>
+  <cpu name='pentium3'/>
+  <cpu name='pentium2'/>
+  <cpu name='pentium'/>
+  <cpu name='486'/>
+  <cpu name='coreduo'/>
+  <cpu name='kvm32'/>
+  <cpu name='qemu32'/>
+  <cpu name='kvm64'/>
+  <cpu name='core2duo'/>
+  <cpu name='phenom'/>
+  <cpu name='qemu64'/>
+  <machine name='pc-i440fx-2.4' alias='pc' maxCpus='255'/>
+  <machine name='pc-1.3' maxCpus='255'/>
+  <machine name='pc-0.12' maxCpus='255'/>
+  <machine name='pc-q35-1.6' maxCpus='255'/>
+  <machine name='pc-q35-1.5' maxCpus='255'/>
+  <machine name='pc-i440fx-1.6' maxCpus='255'/>
+  <machine name='pc-q35-2.2' maxCpus='255'/>
+  <machine name='pc-i440fx-1.7' maxCpus='255'/>
+  <machine name='pc-q35-2.1' maxCpus='255'/>
+  <machine name='pc-0.11' maxCpus='255'/>
+  <machine name='pc-0.10' maxCpus='255'/>
+  <machine name='pc-i440fx-2.2' maxCpus='255'/>
+  <machine name='pc-1.2' maxCpus='255'/>
+  <machine name='isapc' maxCpus='1'/>
+  <machine name='pc-i440fx-2.3' maxCpus='255'/>
+  <machine name='pc-q35-1.4' maxCpus='255'/>
+  <machine name='pc-0.15' maxCpus='255'/>
+  <machine name='pc-i440fx-1.5' maxCpus='255'/>
+  <machine name='pc-q35-2.0' maxCpus='255'/>
+  <machine name='pc-i440fx-1.4' maxCpus='255'/>
+  <machine name='pc-0.14' maxCpus='255'/>
+  <machine name='pc-1.1' maxCpus='255'/>
+  <machine name='pc-i440fx-2.1' maxCpus='255'/>
+  <machine name='pc-q35-1.7' maxCpus='255'/>
+  <machine name='pc-1.0' maxCpus='255'/>
+  <machine name='pc-i440fx-2.0' maxCpus='255'/>
+  <machine name='pc-q35-2.4' alias='q35' maxCpus='255'/>
+  <machine name='pc-q35-2.3' maxCpus='255'/>
+  <machine name='pc-0.13' maxCpus='255'/>
 </qemuCaps>
diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
index 80f3cd8..1f2d5d7 100644
--- a/tests/qemucapabilitiestest.c
+++ b/tests/qemucapabilitiestest.c
@@ -22,7 +22,8 @@
 #include "testutils.h"
 #include "testutilsqemu.h"
 #include "qemumonitortestutils.h"
-
+#define __QEMU_CAPSRIV_H_ALLOW__
+#include "qemu/qemu_capspriv.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
@@ -86,8 +87,8 @@ testQemuFeedMonitor(char *replies,
 }
 
 static int
-testQemuCapsCompare(virQEMUCapsPtr capsExpected,
-                    virQEMUCapsPtr capsActual)
+testQemuCapsFlagsCompare(virQEMUCapsPtr capsExpected,
+                         virQEMUCapsPtr capsActual)
 {
     int ret = 0;
     size_t i;
@@ -116,11 +117,13 @@ testQemuCaps(const void *opaque)
 {
     int ret = -1;
     const testQemuData *data = opaque;
-    char *repliesFile = NULL, *capsFile = NULL;
+    char *repliesFile = NULL;
+    char *capsFile = NULL;
     char *replies = NULL;
     qemuMonitorTestPtr mon = NULL;
     virQEMUCapsPtr capsExpected = NULL;
     virQEMUCapsPtr capsActual = NULL;
+    char *actual = NULL;
 
     if (virAsprintf(&repliesFile, "%s/qemucapabilitiesdata/%s.%s.replies",
                     abs_srcdir, data->base, data->archName) < 0 ||
@@ -134,17 +137,19 @@ testQemuCaps(const void *opaque)
     if (!(mon = testQemuFeedMonitor(replies, data->xmlopt)))
         goto cleanup;
 
-    if (!(capsExpected = qemuTestParseCapabilities(capsFile)))
-        goto cleanup;
-
-    if (!(capsActual = virQEMUCapsNew()))
-        goto cleanup;
-
-    if (virQEMUCapsInitQMPMonitor(capsActual,
+    if (!(capsActual = virQEMUCapsNew()) ||
+        virQEMUCapsInitQMPMonitor(capsActual,
                                   qemuMonitorTestGetMonitor(mon)) < 0)
         goto cleanup;
 
-    if (testQemuCapsCompare(capsExpected, capsActual) < 0)
+    if ((capsExpected = qemuTestParseCapabilities(capsFile)) &&
+        testQemuCapsFlagsCompare(capsExpected, capsActual) < 0)
+        goto cleanup;
+
+    if (!(actual = virQEMUCapsFormatCache(capsActual, 0, 0)))
+        goto cleanup;
+
+    if (virtTestCompareToFile(actual, capsFile) < 0)
         goto cleanup;
 
     ret = 0;
@@ -152,6 +157,7 @@ testQemuCaps(const void *opaque)
     VIR_FREE(repliesFile);
     VIR_FREE(capsFile);
     VIR_FREE(replies);
+    VIR_FREE(actual);
     qemuMonitorTestFree(mon);
     virObjectUnref(capsExpected);
     virObjectUnref(capsActual);
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 114cd24..8f7f52b 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -452,48 +452,19 @@ virQEMUCapsPtr
 qemuTestParseCapabilities(const char *capsFile)
 {
     virQEMUCapsPtr qemuCaps = NULL;
-    xmlDocPtr xml;
-    xmlXPathContextPtr ctxt = NULL;
-    ssize_t i, n;
-    xmlNodePtr *nodes = NULL;
+    time_t qemuctime;
+    time_t selfctime;
+    unsigned long version;
 
-    if (!(xml = virXMLParseFileCtxt(capsFile, &ctxt)))
+    if (!(qemuCaps = virQEMUCapsNew()) ||
+        virQEMUCapsLoadCache(qemuCaps, capsFile,
+                             &qemuctime, &selfctime, &version) < 0)
         goto error;
 
-    if ((n = virXPathNodeSet("/qemuCaps/flag", ctxt, &nodes)) < 0) {
-        fprintf(stderr, "failed to parse qemu capabilities flags");
-        goto error;
-    }
-
-    if (n > 0) {
-        if (!(qemuCaps = virQEMUCapsNew()))
-            goto error;
-
-        for (i = 0; i < n; i++) {
-            char *str = virXMLPropString(nodes[i], "name");
-            if (str) {
-                int flag = virQEMUCapsTypeFromString(str);
-                if (flag < 0) {
-                    fprintf(stderr, "Unknown qemu capabilities flag %s", str);
-                    VIR_FREE(str);
-                    goto error;
-                }
-                VIR_FREE(str);
-                virQEMUCapsSet(qemuCaps, flag);
-            }
-        }
-    }
-
-    VIR_FREE(nodes);
-    xmlFreeDoc(xml);
-    xmlXPathFreeContext(ctxt);
     return qemuCaps;
 
  error:
-    VIR_FREE(nodes);
     virObjectUnref(qemuCaps);
-    xmlFreeDoc(xml);
-    xmlXPathFreeContext(ctxt);
     return NULL;
 }
 
-- 
2.8.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]