On Mon, Nov 25, 2024 at 14:46:38 -0500, Collin Walling wrote:
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(a)linux.ibm.com>
---
docs/manpages/virsh.rst | 6 ++++++
include/libvirt/libvirt-domain.h | 12 ++++++++++++
src/libvirt-domain.c | 2 +-
src/qemu/qemu_capabilities.c | 20 ++++++++++++++++++++
src/qemu/qemu_capabilities.h | 3 +++
src/qemu/qemu_driver.c | 8 +++++++-
tools/virsh-host.c | 9 ++++++++-
7 files changed, 57 insertions(+), 3 deletions(-)
I would split this patch to at least separate virsh changes from the
rest, but even splitting it into three patches (public API, qemu, virsh)
would work as well.
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 2e525d3fac..d3b8ff4e1c 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -568,6 +568,7 @@ domcapabilities
domcapabilities [virttype] [emulatorbin] [arch] [machine]
[--xpath EXPRESSION] [--wrap]
+ [--disabled-deprecated-features]
s/disabled/disable/
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 **--disabled-deprecated-features** argument will modify the contents
s/disabled/disable/
+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
-----------------
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index d4f1573954..0d7e54a3dc 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -1491,6 +1491,18 @@ int virDomainMigrateGetMaxSpeed(virDomainPtr domain,
int virDomainMigrateStartPostCopy(virDomainPtr domain,
unsigned int flags);
+/**
+ * virConnectGetDomainCapabilitiesFlags:
+ *
+ * Domain capabilities flags.
+ *
+ * Since: 10.10.0
Obviously 11.0.0 here and a few lines below
+ */
+typedef enum {
+ /* Report host model with deprecated features disabled. (Since: 10.10.0) */
+ VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES = (1 << 0),
+} virConnectGetDomainCapabilitiesFlags;
+
char * virConnectGetDomainCapabilities(virConnectPtr conn,
const char *emulatorbin,
const char *arch,
Jirka