DO_TEST_CPUID(arch, host, json) is a multipart test. It consists of the following tests: - cpuTestHostCPUID() - cpuTestGuestCPUID(with JSON_* flag) - cpuTestCPUIDSignature() - DO_TEST_JSON(): - if json==JSON_MODELS: - cpuTestGuestCPUID(without JSON_* flag) - cpuTestJSONCPUID() - cputestJSONSignature() Notice that for tests with json==JSON_MODELS, cpuTestGuestCPUID() is actually called twice but with different arguments. The first one passes JSON_MODELS to the test function, while the second one passes 0. The main difference in behavior when calling cpuTestGuestCPUID() with or without the flag is that in the first case, it parses the captured qemu output from $ARCH-cpuid-$CPU.json. It extracts the cpu model list from that JSON, and uses that to filter out possible cpu models to match. In other words, it tries to match the cpu to a model that was supported by the qemu version that was used to generate this JSON file. When it finds a match, it generates a cpu definition and compares the xml form of that definition with the file $ARCH-cpuid-$CPU-guest.xml. When called without the JSON_MODELS flag, it simply attempts to match it against the full libvirt cpu map and doesn't attempt to filter out any matches based on the JSON qemu cpu model list. After it finds a match, it generates an xml definition for the cpu and compares it to the same file listed above. So if these two invocations disagree on the cpu match (e.g. because libvirt has added a cpu model to its cpu map that matches better than one that was supported by the version of qemu that generated the JSON file) the test will fail. This duplicate call to cpuTestGuestCPUID() was originally added in commit 49c945a6f5c885394507f88086cc2f9461df7c27. The original justification for that commit was to fix test failures when the Qemu driver was disabled. But since DO_TEST_JSON() is #defined empty when qemu is disabled, this particular invocation would not even be executed in this scenario, so it doesn't seem relevant. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Libvirt API for virtualization
Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
For some of these hypervisors, it provides a stateful management daemon which runs on the virtualization host allowing access to the API both by non-privileged local users and remote users.
Layered packages provide bindings of the libvirt C API into other languages including Python, Perl, PHP, Go, Java, OCaml, as well as mappings into object systems such as GObject, CIM and SNMP.
Further information about the libvirt project can be found on the website:
License
The libvirt C API is distributed under the terms of GNU Lesser General Public License, version 2.1 (or later). Some parts of the code that are not part of the C library may have the more restrictive GNU General Public License, version 2.0 (or later). See the files COPYING.LESSER
and COPYING
for full license terms & conditions.
Installation
Instructions on building and installing libvirt can be found on the website:
https://libvirt.org/compiling.html
Contributing
The libvirt project welcomes contributions in many ways. For most components the best way to contribute is to send patches to the primary development mailing list. Further guidance on this can be found on the website:
https://libvirt.org/contribute.html
Contact
The libvirt project has two primary mailing lists:
- users@lists.libvirt.org (for user discussions)
- devel@lists.libvirt.org (for development only)
Further details on contacting the project are available on the website: