]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Add --supported-cpu-features option for domcapabilities
authorJiri Denemark <jdenemar@redhat.com>
Fri, 29 May 2026 10:52:59 +0000 (12:52 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 2 Jun 2026 11:45:27 +0000 (13:45 +0200)
The option corresponds to the
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES API flag.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
docs/manpages/virsh.rst
tools/virsh-host.c

index 9f888845df1bca6b17b0cf8cb39adb0142bd6e99..1bc5c56b0d990f8c7f770c54d869d81e5ca248dd 100644 (file)
@@ -592,7 +592,7 @@ domcapabilities
    domcapabilities [virttype] [emulatorbin] [arch] [machine]
                    [--xpath EXPRESSION] [--wrap]
                    [--disable-deprecated-features]
-                   [--expand-cpu-features]
+                   [--expand-cpu-features] [--supported-cpu-features]
 
 
 Print an XML document describing the domain capabilities for the
@@ -644,6 +644,12 @@ to contain all required CPU features including those implicitly enabled by the
 selected CPU model. Without this flag features that are part of the CPU model
 itself will not be listed.
 
+The **--supported-cpu-features** option will update the host-model CPU
+definition with features that are supported on the host, but will not be
+enabled by default when starting a domain with host-model CPU. Using both
+**--supported-cpu-features** and **--expand-cpu-features** will provide a
+complete list of features that can be enabled on the host.
+
 
 pool-capabilities
 -----------------
index 67aac365f254cd9774e4ccf910e53fa6ff7c3dd8..0c18db67c438679b0d0470cbb37ce63a88f8e078 100644 (file)
@@ -123,6 +123,10 @@ static const vshCmdOptDef opts_domcapabilities[] = {
      .type = VSH_OT_BOOL,
      .help = N_("expand 'host-model' CPU to also show features enabled by the CPU model"),
     },
+    {.name = "supported-cpu-features",
+     .type = VSH_OT_BOOL,
+     .help = N_("include all supported CPU features in 'host-model' mode, not only those enabled by default"),
+    },
     {.name = NULL}
 };
 
@@ -145,6 +149,9 @@ cmdDomCapabilities(vshControl *ctl, const vshCmd *cmd)
     if (vshCommandOptBool(cmd, "expand-cpu-features"))
         flags |= VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES;
 
+    if (vshCommandOptBool(cmd, "supported-cpu-features"))
+        flags |= VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES;
+
     if (vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
         vshCommandOptString(ctl, cmd, "emulatorbin", &emulatorbin) < 0 ||
         vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||