Blame SOURCES/0021-appliance-Use-cpu-mode-maximum-for-cpu-max-on-libvir.patch

196f39
From 7dde1007525ec235e769351be15ca5de34eeda4a Mon Sep 17 00:00:00 2001
196f39
From: "Richard W.M. Jones" <rjones@redhat.com>
196f39
Date: Thu, 18 Mar 2021 12:32:26 +0000
196f39
Subject: [PATCH] appliance: Use <cpu mode="maximum"/> for -cpu max on libvirt.
196f39
196f39
Note this requires libvirt >= 7.1.0 which was only released in March 2021.
196f39
196f39
With an older libvirt you will see this error:
196f39
196f39
  Original error from libvirt: unsupported configuration: Invalid mode attribute 'maximum' [code=67 int1=-1]
196f39
196f39
In theory we could check if this is supported by looking at the
196f39
libvirt capabilities and fall back, but this commit does not do that,
196f39
in the expectation that most people will be using the default backend
196f39
(direct) and on Fedora/RHEL we will add an explicit minimum version
196f39
dependency to the package.
196f39
196f39
qemu support has been around quite a bit longer (at least since 2017).
196f39
196f39
Fixes: commit 30f74f38bd6e42e783ba80895f4d6826abddd417
196f39
(cherry picked from commit 13ceb6a87b2869909a6a0e3c8caa962b72e4cb0e)
196f39
---
196f39
 lib/launch-libvirt.c | 9 ++-------
196f39
 1 file changed, 2 insertions(+), 7 deletions(-)
196f39
196f39
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
196f39
index e3ff1ffe0..db619910f 100644
196f39
--- a/lib/launch-libvirt.c
196f39
+++ b/lib/launch-libvirt.c
196f39
@@ -1170,13 +1170,8 @@ construct_libvirt_xml_cpu (guestfs_h *g,
196f39
         } end_element ();
196f39
       }
196f39
       else if (STREQ (cpu_model, "max")) {
196f39
-        if (params->data->is_kvm)
196f39
-          attribute ("mode", "host-passthrough");
196f39
-        else
196f39
-          attribute ("mode", "host-model");
196f39
-        start_element ("model") {
196f39
-          attribute ("fallback", "allow");
196f39
-        } end_element ();
196f39
+        /* https://bugzilla.redhat.com/show_bug.cgi?id=1935572#c11 */
196f39
+        attribute ("mode", "maximum");
196f39
       }
196f39
       else
196f39
         single_element ("model", cpu_model);
196f39
-- 
196f39
2.31.1
196f39