Blame SOURCES/0018-convert-linux-Require-host-cpu-for-all-RHEL-alike-9.patch

c659c5
From 227313ca73d24eaaa0b82aca94de2278bca0f95b Mon Sep 17 00:00:00 2001
c659c5
From: "Richard W.M. Jones" <rjones@redhat.com>
c659c5
Date: Mon, 6 Feb 2023 12:13:25 +0000
c659c5
Subject: [PATCH] convert: linux: Require host cpu for all RHEL-alike >= 9
c659c5
c659c5
RHEL >= 9 and compatible distros like Rocky >= 9 will not boot using
c659c5
the default qemu CPU.  You will see an error at boot:
c659c5
c659c5
  Fatal glibc error: CPU does not support x86-64-v2
c659c5
c659c5
Instead you need to use -cpu host.
c659c5
c659c5
In commit f28757c6d1 ("convert_linux: set "gcaps_default_cpu = false"
c659c5
for x86_64 RHEL-9.0+ guests") we fixed this specifically for RHEL >= 9.
c659c5
c659c5
This commit extends the same fix to all RHEL family distros.
c659c5
c659c5
Updates: commit f28757c6d100060c65212ea55cfa59d308dcb850
c659c5
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2166619
c659c5
Reported-by: Ming Xie
c659c5
Thanks: Laszlo Ersek
c659c5
(cherry picked from commit 9f12b95bbe7bc2850ce4ba134c46a3cc5fd1167d)
c659c5
---
c659c5
 convert/convert_linux.ml | 4 ++--
c659c5
 1 file changed, 2 insertions(+), 2 deletions(-)
c659c5
c659c5
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
c659c5
index 41767e62..27bc4ae4 100644
c659c5
--- a/convert/convert_linux.ml
c659c5
+++ b/convert/convert_linux.ml
c659c5
@@ -202,9 +202,9 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
c659c5
 
c659c5
     (* RHEL >= 9.0 on x86_64 requires the processor to support the "x86-64-v2"
c659c5
      * microarchitecture level, which the default QEMU VCPU model does not
c659c5
-     * satisfy.  Refer to RHBZ#2076013.
c659c5
+     * satisfy.  Refer to RHBZ#2076013 RHBZ#2166619.
c659c5
      *)
c659c5
-    let default_cpu_suffices = inspect.i_distro <> "rhel" ||
c659c5
+    let default_cpu_suffices = family <> `RHEL_family ||
c659c5
                                inspect.i_arch <> "x86_64" ||
c659c5
                                inspect.i_major_version < 9 in
c659c5