From cb0feb7db488d299e4ed81b49557ef068f6c9ba4 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 25 Jul 2022 15:28:25 +0200 Subject: [PATCH] relax qemu64 VCPU feature checking in the libvirt output resolves: rhbz#2107503 Signed-off-by: Laszlo Ersek --- ...bvirt_xml-relax-VCPU-feature-checkin.patch | 69 +++++++++++++++++++ virt-v2v.spec | 6 +- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 0030-output-create_libvirt_xml-relax-VCPU-feature-checkin.patch diff --git a/0030-output-create_libvirt_xml-relax-VCPU-feature-checkin.patch b/0030-output-create_libvirt_xml-relax-VCPU-feature-checkin.patch new file mode 100644 index 0000000..158b662 --- /dev/null +++ b/0030-output-create_libvirt_xml-relax-VCPU-feature-checkin.patch @@ -0,0 +1,69 @@ +From 29c6ee9322da082e3be9faa94cf4a6840b49cd97 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Fri, 22 Jul 2022 09:36:27 +0200 +Subject: [PATCH] output/create_libvirt_xml: relax VCPU feature checking for + "qemu64" + +When the source domain doesn't specify a VCPU model ("s_cpu_model" is +None), and the guest OS is assumed to work with the default VCPU model +("gcaps_default_cpu" is true), we don't output any element. In that +case, libvirtd augments the domain config with: + + [1] + qemu64 + + +where the @check='none' attribute ensures that the converted domain will +be launched, for example, on an Intel host, despite the "qemu64" VCPU +model containing AMD-only feature flags such as "svm". + +However, if the source domain explicitly specifies the "qemu64" model +(mostly seen with "-i libvirt -ic qemu://..."), we presently output + + [2] + qemu64 + + +which libvirtd completes as + + [3] + qemu64 + + +In [3], cpu/@match='minimum' and cpu/model/@fallback='allow' are both +laxer than @match='exact' and @fallback='forbid', respectively, in [1]. + +However, cpu/@check='partial' in [3] is stricter than @check='none' in +[1]; it causes libvirtd to catch the "svm" feature flag on an Intel host, +and prevents the converted domain from starting. + +The "qemu64" VCPU model is supposed to run on every possible host +, +therefore make an exception for the explicitly specified "qemu64" VCPU +model, and generate the @check='none' attribute. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2107503 +Signed-off-by: Laszlo Ersek +Message-Id: <20220722073627.6511-1-lersek@redhat.com> +Acked-by: Richard W.M. Jones +(cherry picked from commit e5297c3180fd3ebea41a40f4c5a66969a24b9ff3) +--- + output/create_libvirt_xml.ml | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml +index 531a4f75..bd01304d 100644 +--- a/output/create_libvirt_xml.ml ++++ b/output/create_libvirt_xml.ml +@@ -192,6 +192,8 @@ let create_libvirt_xml ?pool source inspect + List.push_back cpu_attrs ("mode", "host-passthrough"); + | Some model -> + List.push_back cpu_attrs ("match", "minimum"); ++ if model = "qemu64" then ++ List.push_back cpu_attrs ("check", "none"); + (match source.s_cpu_vendor with + | None -> () + | Some vendor -> +-- +2.31.1 + diff --git a/virt-v2v.spec b/virt-v2v.spec index 1c18abe..664dfb1 100644 --- a/virt-v2v.spec +++ b/virt-v2v.spec @@ -16,7 +16,7 @@ Name: virt-v2v Epoch: 1 Version: 2.0.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Convert a virtual machine to run on KVM License: GPLv2+ @@ -62,6 +62,7 @@ Patch0026: 0026-common-Adapt-to-renamed-function-On_exit.rmdir-On_ex.patch Patch0027: 0027-o-rhv-Unmount-the-temporary-NFS-mountpoint-as-late-a.patch Patch0028: 0028-output-Permit-output-modes-to-wait-on-the-local-NBD-.patch Patch0029: 0029-o-rhv-Wait-for-the-NBD-server-to-exit-to-avoid-a-rac.patch +Patch0030: 0030-output-create_libvirt_xml-relax-VCPU-feature-checkin.patch %if !0%{?rhel} # libguestfs hasn't been built on i686 for a while since there is no @@ -340,6 +341,9 @@ rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-v2v-in-place.1* %changelog +* Mon Jul 25 Laszlo Ersek - 1:2.0.7-3 +- relax qemu64 VCPU feature checking in the libvirt output + resolves rhbz#2107503 * Fri Jul 15 2022 Richard W.M. Jones - 1:2.0.7-2 - Rebase to stable branch version 2.0.7 resolves: rhbz#2059287, rhbz#1658126, rhbz#1788823, rhbz#1854275