From 54baaefe54e46274637e08cf431b766bd6df243c Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Jan 19 2021 08:33:10 +0000 Subject: Add upstream PR for libvirt fixes --- diff --git a/oz-guest-always-use-cpu-host-passthrough.patch b/oz-guest-always-use-cpu-host-passthrough.patch new file mode 100644 index 0000000..5b4ea83 --- /dev/null +++ b/oz-guest-always-use-cpu-host-passthrough.patch @@ -0,0 +1,46 @@ +From f73d7cff45504deb36b502d073157576528a6eb3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Fri, 15 Jan 2021 15:49:05 +0000 +Subject: [PATCH] Guest: fix to always use host-passthrough CPU for all arches +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The use of host passthrough was restricted to just arm architectures, +which meant other arches got their built in default, which is almost +never what you want. eg x86 gets qemu64 which lacks so many features +that some guests will not function at all. + +There is no need to care about live migration with Oz, so it should +unconditionally use host-passthrough for all architectures when KVM +is enabled. + +Furthermore the way host-passthrough was requested was incorrect +and relying on an accident of the libvirt QEMU impl. It needs to +use mode=host-passthrough, not mode=custom + model=host. Libvirt +should block the latter from being used. + +Signed-off-by: Daniel P. Berrangé +--- + oz/Guest.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index 92bdc71c..aac57bd8 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -470,10 +470,10 @@ + oz.ozutil.lxml_subelement(features, "apic") + oz.ozutil.lxml_subelement(features, "pae") + # CPU +- if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": +- # Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm +- cpu = oz.ozutil.lxml_subelement(domain, "cpu", None, {'mode': 'host-passthrough', 'check': 'none'}) +- oz.ozutil.lxml_subelement(cpu, "model", "host", {'fallback': 'allow'}) ++ if self.libvirt_type == "kvm": ++ # If using KVM, we always want the best CPU the host can offer ++ # as we don't need to worry about live migration portability ++ oz.ozutil.lxml_subelement(domain, "cpu", None, {'mode': 'host-passthrough'}) + # os + osNode = oz.ozutil.lxml_subelement(domain, "os") + mods = None diff --git a/oz.spec b/oz.spec index a81f6f1..7578853 100644 --- a/oz.spec +++ b/oz.spec @@ -1,6 +1,6 @@ Name: oz Version: 0.17.0 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Library and utilities for automated guest OS installs License: LGPLv2 URL: http://github.com/clalancette/oz @@ -26,6 +26,8 @@ Patch14: oz-0.17.0-s390-input.patch Patch15: 0001-aarch64-for-linux-tty-if-acpi.patch Patch16: 0002-aarch64-Less-strict-CPU-checking-for-armv7-guests-on.patch #Patch17: 0003-fedora-default-to-F30-for-versions-30.patch +# https://github.com/clalancette/oz/pull/283 +Patch18: oz-guest-always-use-cpu-host-passthrough.patch BuildArch: noarch @@ -104,6 +106,9 @@ fi %{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info %changelog +* Tue Jan 19 2021 Peter Robinson - 0.17.0-13 +- Add upstream PR for libvirt fixes + * Mon Oct 05 2020 Peter Robinson - 0.17.0-12 - Futher arm fixes, drop EOL conditionals