]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qmp: Add deprecation information to query-machines
authorEduardo Habkost <ehabkost@redhat.com>
Sat, 8 Jun 2019 23:34:47 +0000 (20:34 -0300)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 5 Jul 2019 20:08:04 +0000 (17:08 -0300)
Export machine type deprecation status through the query-machines
QMP command.  With this, libvirt and management software will be
able to show this information to users and/or suggest changes to
VM configuration to avoid deprecated machines.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190608233447.27970-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
hw/core/machine-qmp-cmds.c
qapi/machine.json

index 754ce776640668df6039eba4d379e6beebdc8e97..5bd95b8ab0b89374333511da10ee3a91485bd506 100644 (file)
@@ -227,6 +227,7 @@ MachineInfoList *qmp_query_machines(Error **errp)
         info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
         info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
         info->numa_mem_supported = mc->numa_mem_supported;
+        info->deprecated = !!mc->deprecation_reason;
 
         entry = g_malloc0(sizeof(*entry));
         entry->value = info;
index 78d34ef71763e712ab2f18764e41e2f30e41eba3..6db8a7e2eca7bd224989ae8c5f85fedb40e0c1ee 100644 (file)
 # @numa-mem-supported: true if '-numa node,mem' option is supported by
 #                      the machine type and false otherwise (since 4.1)
 #
+# @deprecated: if true, the machine type is deprecated and may be removed
+#              in future versions of QEMU according to the QEMU deprecation
+#              policy (since 4.1.0)
+#
 # Since: 1.2.0
 ##
 { 'struct': 'MachineInfo',
   'data': { 'name': 'str', '*alias': 'str',
             '*is-default': 'bool', 'cpu-max': 'int',
-            'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool'} }
+            'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
+            'deprecated': 'bool' } }
 
 ##
 # @query-machines: