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

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