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 <ehabk...@redhat.com> Message-Id: <20190608233447.27970-2-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- qapi/misc.json | 7 ++++++- vl.c | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qapi/misc.json b/qapi/misc.json index ccd56c9191..733ffefa40 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -2017,12 +2017,17 @@ # @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: diff --git a/vl.c b/vl.c index 23fe3e753b..28cc6c4c93 100644 --- a/vl.c +++ b/vl.c @@ -1362,6 +1362,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; -- 2.18.0.rc1.1.g3f1ff2140