From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Michal Privoznik" <mprivozn@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [Qemu-devel] [PATCH v2 1/1] qmp: Add deprecation information to query-machines
Date: Sat, 8 Jun 2019 20:34:47 -0300 [thread overview]
Message-ID: <20190608233447.27970-2-ehabkost@redhat.com> (raw)
In-Reply-To: <20190608233447.27970-1-ehabkost@redhat.com>
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>
---
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;
--
2.18.0.rc1.1.g3f1ff2140
next prev parent reply other threads:[~2019-06-08 23:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-08 23:34 [Qemu-devel] [PATCH v2 0/1] Export machine type deprecation info through QMP Eduardo Habkost
2019-06-08 23:34 ` Eduardo Habkost [this message]
2019-06-25 8:37 ` [Qemu-devel] [PATCH v2 1/1] qmp: Add deprecation information to query-machines Marcel Apfelbaum
2019-06-24 18:03 ` [Qemu-devel] [PATCH v2 0/1] Export machine type deprecation info through QMP Eduardo Habkost
2019-06-24 22:48 ` Wainer dos Santos Moschetta
2019-06-25 12:00 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190608233447.27970-2-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=mprivozn@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).