From 468b03e0ee4a917ae26106f6e57081bcd9e7a65b Mon Sep 17 00:00:00 2001 From: Kashyap Chamarthy Date: Wed, 11 Jan 2023 17:55:20 +0100 Subject: 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 --- .../notes/use-compareHypervisorCPU-b75c8f097cc73556.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 releasenotes/notes/use-compareHypervisorCPU-b75c8f097cc73556.yaml (limited to 'releasenotes') diff --git a/releasenotes/notes/use-compareHypervisorCPU-b75c8f097cc73556.yaml b/releasenotes/notes/use-compareHypervisorCPU-b75c8f097cc73556.yaml new file mode 100644 index 0000000000..924e09a602 --- /dev/null +++ b/releasenotes/notes/use-compareHypervisorCPU-b75c8f097cc73556.yaml @@ -0,0 +1,12 @@ +--- +fixes: + - | + Nova's use of libvirt's compareCPU() API has become error-prone as + it doesn't take into account host hypervisor's capabilities. With + QEMU >=2.9 and libvirt >= 4.4.0, libvirt will do the right thing in + terms of CPU comparison checks via a new replacement API, + compareHypervisorCPU(). Nova satisfies the said minimum version + requirements of QEMU and libvirt by a good margin. + + This change replaces the usage of older API, compareCPU(), with the + new one, compareHypervisorCPU(). -- cgit v1.2.1