Enable building for ppc64le

This commit is contained in:
Eduard Abdullin 2026-04-17 09:24:05 +00:00 committed by root
commit 0c336e4db7
5 changed files with 215 additions and 2 deletions

View File

@ -0,0 +1,54 @@
From 4a81cb382970dce339164a13cd18002e789ec10b Mon Sep 17 00:00:00 2001
Message-ID: <4a81cb382970dce339164a13cd18002e789ec10b.1773242419.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 11 Mar 2026 11:31:06 +0100
Subject: [PATCH] Introduce EXPAND_CPU_FEATURES flag for domain capabilities
The new VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES flag for
virConnectGetDomainCapabilities can be used to request the host-model
CPU definition to include all supported features (normally only extra
features relative to the selected CPU model are listed).
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 8aa13d1b16b08feea37ecacc85540671e7995bb8)
https://issues.redhat.com/browse/RHEL-154551
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
include/libvirt/libvirt-domain.h | 2 ++
src/libvirt-domain.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 7759ddeaad..df92c520c1 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -1501,6 +1501,8 @@ int virDomainMigrateStartPostCopy(virDomainPtr domain,
typedef enum {
/* Report host model with deprecated features disabled. (Since: 11.0.0) */
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES = (1 << 0),
+ /* Report all host model CPU features. (Since: 12.2.0) */
+ VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES = (1 << 1),
} virConnectGetDomainCapabilitiesFlags;
char * virConnectGetDomainCapabilities(virConnectPtr conn,
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index efc26a41d9..c262c9607a 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -12174,6 +12174,11 @@ virDomainSetUserPassword(virDomainPtr dom,
* instance, if host, libvirt and qemu is capable of VFIO
* passthrough and so on.
*
+ * If @flags includes VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES,
+ * libvirt will explicitly list all CPU features (in host-model CPU definition)
+ * that are supported on the host. Without this flag features that are part of
+ * the CPU model itself will not be listed.
+ *
* Returns NULL in case of error or an XML string
* defining the capabilities.
*
--
2.53.0

View File

@ -0,0 +1,34 @@
From 5c32760042fe8d59260f1d801f9122af3b722206 Mon Sep 17 00:00:00 2001
Message-ID: <5c32760042fe8d59260f1d801f9122af3b722206.1773242419.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 11 Mar 2026 12:13:45 +0100
Subject: [PATCH] docs: Clarify host-model description in domain capabilities
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 0b54c9d535b9b7c832ff8422dca28c84eb75ed2e)
https://issues.redhat.com/browse/RHEL-154551
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
docs/formatdomaincaps.rst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst
index aee0af1045..48033d1bd6 100644
--- a/docs/formatdomaincaps.rst
+++ b/docs/formatdomaincaps.rst
@@ -244,6 +244,10 @@ more details about it:
reports physical address size of the host CPU if this value is available and
applicable for the requested domain type. This is useful for computing
baseline CPU definition which should be compatible with several hosts.
+ Consistently with all other CPU definitions used by libvirt, features
+ implicitly enabled by the selected CPU model (in ``model`` sub element) are
+ not listed. Use ``--expand-cpu-features`` virsh option or the equivalent API
+ flag to request all supported features to be listed in the CPU definition.
``custom``
The ``mode`` element contains a list of supported CPU models, each described
by a dedicated ``model`` element. The ``usable`` attribute specifies whether
--
2.53.0

View File

@ -0,0 +1,47 @@
From bb2de2abe87a3ba8194da248cf5de84d60b0a2b5 Mon Sep 17 00:00:00 2001
Message-ID: <bb2de2abe87a3ba8194da248cf5de84d60b0a2b5.1773242419.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 11 Mar 2026 12:12:40 +0100
Subject: [PATCH] qemu: Implement
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 3215fee34967c49f37a965154879fc5860293cac)
https://issues.redhat.com/browse/RHEL-154551
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/qemu/qemu_driver.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 98bfe8124d..2de0ea6a9c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16552,7 +16552,8 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
virDomainVirtType virttype;
g_autoptr(virDomainCaps) domCaps = NULL;
- virCheckFlags(VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES,
+ virCheckFlags(VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES |
+ VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES,
NULL);
if (virConnectGetDomainCapabilitiesEnsureACL(conn) < 0)
@@ -16577,6 +16578,12 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
domCaps->cpu.hostModel);
}
+ if (flags & VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES) {
+ virCPUDef *cpu = domCaps->cpu.hostModel;
+ if (cpu && virCPUExpandFeatures(arch, cpu) < 0)
+ return NULL;
+ }
+
return virDomainCapsFormat(domCaps);
}
--
2.53.0

View File

@ -0,0 +1,68 @@
From ee175567f79c3c9359ed209973172e88cc8c9c31 Mon Sep 17 00:00:00 2001
Message-ID: <ee175567f79c3c9359ed209973172e88cc8c9c31.1773242419.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 11 Mar 2026 12:13:22 +0100
Subject: [PATCH] virsh: Add --expand-cpu-features option for domcapabilities
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 57e5bb55cef5e97eea14fcecef7114e804576d6c)
https://issues.redhat.com/browse/RHEL-154551
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
docs/manpages/virsh.rst | 5 +++++
tools/virsh-host.c | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index b75e00beb6..e445672c2a 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -584,6 +584,7 @@ domcapabilities
domcapabilities [virttype] [emulatorbin] [arch] [machine]
[--xpath EXPRESSION] [--wrap]
[--disable-deprecated-features]
+ [--expand-cpu-features]
Print an XML document describing the domain capabilities for the
@@ -630,6 +631,10 @@ of host-model CPU XML, updating the features list with any features
flagged as deprecated for the CPU model by the hypervisor. These
features will be paired with the "disable" policy.
+The **--expand-cpu-features** option will cause the host-model CPU definition
+to contain all CPU features supported on the host including those implicitly
+enabled by the selected CPU model.
+
pool-capabilities
-----------------
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 9a2b689620..c692d0ea5b 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -118,6 +118,10 @@ static const vshCmdOptDef opts_domcapabilities[] = {
.type = VSH_OT_BOOL,
.help = N_("report host CPU model with deprecated features disabled"),
},
+ {.name = "expand-cpu-features",
+ .type = VSH_OT_BOOL,
+ .help = N_("show all features in host CPU model"),
+ },
{.name = NULL}
};
@@ -137,6 +141,9 @@ cmdDomCapabilities(vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptBool(cmd, "disable-deprecated-features"))
flags |= VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES;
+ if (vshCommandOptBool(cmd, "expand-cpu-features"))
+ flags |= VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES;
+
if (vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
vshCommandOptString(ctl, cmd, "emulatorbin", &emulatorbin) < 0 ||
vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||
--
2.53.0

View File

@ -293,7 +293,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 10.10.0
Release: 15.8%{?dist}%{?extra_release}.alma.1
Release: 15.9%{?dist}%{?extra_release}.alma.1
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
URL: https://libvirt.org/
@ -513,6 +513,10 @@ Patch209: libvirt-qemu-correctly-detect-working-TDX-support.patch
Patch210: libvirt-qemu_validate-Drop-VIR_DOMAIN_HYPERV_SYNIC-dependency-on-VIR_DOMAIN_HYPERV_VPINDEX.patch
Patch211: libvirt-qemu_validate-Drop-VIR_DOMAIN_HYPERV_STIMER-dependency-on-VIR_DOMAIN_HYPERV_VPINDEX.patch
Patch212: libvirt-qemu-Ignore-cmp_legacy-CPU-flag.patch
Patch213: libvirt-Introduce-EXPAND_CPU_FEATURES-flag-for-domain-capabilities.patch
Patch214: libvirt-qemu-Implement-VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES.patch
Patch215: libvirt-virsh-Add-expand-cpu-features-option-for-domcapabilities.patch
Patch216: libvirt-docs-Clarify-host-model-description-in-domain-capabilities.patch
Requires: libvirt-daemon = %{version}-%{release}
@ -2838,9 +2842,15 @@ exit 0
%endif
%changelog
* Thu Mar 12 2026 Eduard Abdullin <eabdullin@almalinux.org> - 10.10.0-15.8.alma.1
* Fri Apr 17 2026 Eduard Abdullin <eabdullin@almalinux.org> - 10.10.0-15.9.alma.1
- Enable building for ppc64le
* Wed Mar 11 2026 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-15.9.el9_7
- Introduce EXPAND_CPU_FEATURES flag for domain capabilities (RHEL-154551)
- qemu: Implement VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES (RHEL-154551)
- virsh: Add --expand-cpu-features option for domcapabilities (RHEL-154551)
- docs: Clarify host-model description in domain capabilities (RHEL-154551)
* Wed Feb 11 2026 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-15.8.el9_7
- qemu: Ignore cmp_legacy CPU flag (RHEL-148500)