]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: add --disable-deprecated-features flag to domcapabilities
authorCollin Walling <walling@linux.ibm.com>
Mon, 16 Dec 2024 23:03:57 +0000 (18:03 -0500)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 17 Dec 2024 10:45:50 +0000 (11:45 +0100)
Add a new flag, --disable-deprecated-features, to the domcapabilities
command.  This will modify the output to show the 'host-model' CPU
with features flagged as deprecated paired with the 'disable' policy.

virsh domcapabilities --disable-deprecated-features

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
docs/manpages/virsh.rst
tools/virsh-host.c

index 2e525d3fac4dcc332f006e0dcb539a077f1e2d4d..e801037c04943486c9fe78511a66d077379a46a5 100644 (file)
@@ -568,6 +568,7 @@ domcapabilities
 
    domcapabilities [virttype] [emulatorbin] [arch] [machine]
                    [--xpath EXPRESSION] [--wrap]
+                   [--disable-deprecated-features]
 
 
 Print an XML document describing the domain capabilities for the
@@ -609,6 +610,11 @@ a standalone document, however, for ease of additional processing,
 the **--wrap** argument will cause the matching node to be wrapped
 in a common root node.
 
+The **--disable-deprecated-features** argument will modify the contents
+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.
+
 
 pool-capabilities
 -----------------
index 2fe64e415f79825e3a8437004663ccba05519fce..f4e7324f42f0a60a7f9682524c37eddd57fdb70a 100644 (file)
@@ -114,6 +114,10 @@ static const vshCmdOptDef opts_domcapabilities[] = {
      .type = VSH_OT_BOOL,
      .help = N_("wrap xpath results in an common root element"),
     },
+    {.name = "disable-deprecated-features",
+     .type = VSH_OT_BOOL,
+     .help = N_("report host CPU model with deprecated features disabled"),
+    },
     {.name = NULL}
 };
 
@@ -126,10 +130,13 @@ cmdDomCapabilities(vshControl *ctl, const vshCmd *cmd)
     const char *arch = NULL;
     const char *machine = NULL;
     const char *xpath = NULL;
-    const unsigned int flags = 0; /* No flags so far */
+    unsigned int flags = 0;
     bool wrap = vshCommandOptBool(cmd, "wrap");
     virshControl *priv = ctl->privData;
 
+    if (vshCommandOptBool(cmd, "disable-deprecated-features"))
+        flags |= VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES;
+
     if (vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
         vshCommandOptString(ctl, cmd, "emulatorbin", &emulatorbin) < 0 ||
         vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||