Commit Graph

1 Commits

Author SHA1 Message Date
Kashyap Chamarthy 468b03e0ee libvirt: Replace usage of compareCPU() with compareHypervisorCPU()
The older libvirt API compareCPU() does not take into account the
capabilities of the "host hypervisor" (KVM, QEMU and the details libvirt
knows about the host) when comparing CPUs.  This is causing unwanted
failures during CPU compatibility checks.  To fix this and other related
problems, libvirt has introduced (in v4.4.0) a newer API,
compareHypervisorCPU(), which _does_ take into account the host
hypervisor's capabilities before comparing CPUs.  This will help fix a
range of problems, such as[1][2].

So let's switch to the newer API, which is largely a drop-in
replacement.

In this patch:

 - Introduce a wrapper method, compare_hypervisor_cpu() for libvirt's
   compareHypervisorCPU() API.

 - Update the _compare_cpu() method to use the wrapper method,
   compare_hypervisor_cpu().

 - Update the unit tests to use the newer API, compareHypervisorCPU().

[1] https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1978064
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2138381

Change-Id: Ib523753f52993cfe72e35e0309e429ca879c125c
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
2023-01-24 11:28:43 +01:00