]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Introduce EXPAND_CPU_FEATURES flag for domain capabilities
authorJiri Denemark <jdenemar@redhat.com>
Wed, 11 Mar 2026 10:31:06 +0000 (11:31 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 11 Mar 2026 13:03:59 +0000 (14:03 +0100)
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>
include/libvirt/libvirt-domain.h
src/libvirt-domain.c

index d82406fe050772c8e96d43e029bbb1a5bf877ef8..ccc2c87ea8c0d339d34b2c2389fe1778395f50fb 100644 (file)
@@ -1517,6 +1517,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,
index a1f6efde20713513cef541b11dda0041b90d7ca3..6b8783d57f1c85d8000c9cf4889b04b59fc58093 100644 (file)
@@ -12330,6 +12330,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.
  *