qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/1] qmp: Add deprecation information to quer


From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] [PATCH v2 1/1] qmp: Add deprecation information to query-machines
Date: Tue, 25 Jun 2019 11:37:49 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1



On 6/9/19 2:34 AM, Eduardo Habkost wrote:
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 <address@hidden>
---
Changes v1 -> v2:
* Take a much simpler approach: add a simple `deprecated` bool
   field, instead of including a human-readable message and
   suggested alternatives
---
  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 8b3ca4fdd3..fca793d39c 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -2018,12 +2018,17 @@
  #
  # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
  #
+# @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'} }
+            'hotpluggable-cpus': 'bool',
+            'deprecated': 'bool' } }
##
  # @query-machines:
diff --git a/vl.c b/vl.c
index cd1fbc4cdc..f825d2159c 100644
--- a/vl.c
+++ b/vl.c
@@ -1428,6 +1428,7 @@ MachineInfoList *qmp_query_machines(Error **errp)
          info->name = g_strdup(mc->name);
          info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
          info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
+        info->deprecated = !!mc->deprecation_reason;
entry = g_malloc0(sizeof(*entry));
          entry->value = info;

Reviewed-by: Marcel Apfelbaum <address@hidden>

Thanks,
Marcel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]