From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: libvir-list@redhat.com, pbonzini@redhat.com, berrange@redhat.com,
ehabkost@redhat.com, armbru@redhat.com
Subject: [Qemu-devel] [PATCH v3 2/6] qmp: make "qom-list-properties" show initial property values
Date: Fri, 17 May 2019 09:45:15 +0200 [thread overview]
Message-ID: <1558079119-320634-3-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1558079119-320634-1-git-send-email-imammedo@redhat.com>
Add in the command output object's property values right after creation
(i.e. state of the object returned by object_new() or equivalent).
Follow up patch will add machine property 'numa-mem-supported', which
would allow mgmt to introspect which machine types (versions) still
support legacy "-numa mem=FOO" CLI option and which don't and require
alternative '-numa memdev' option being used.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
qapi/misc.json | 5 ++++-
qmp.c | 5 +++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/qapi/misc.json b/qapi/misc.json
index 8b3ca4f..e333285 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -1365,10 +1365,13 @@
#
# @description: if specified, the description of the property.
#
+# @default: initial property value.
+#
# Since: 1.2
##
{ 'struct': 'ObjectPropertyInfo',
- 'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
+ 'data': { 'name': 'str', 'type': 'str', '*description': 'str',
+ '*default': 'any' } }
##
# @qom-list:
diff --git a/qmp.c b/qmp.c
index b92d62c..8415541 100644
--- a/qmp.c
+++ b/qmp.c
@@ -593,6 +593,11 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename,
info->type = g_strdup(prop->type);
info->has_description = !!prop->description;
info->description = g_strdup(prop->description);
+ if (obj) {
+ info->q_default =
+ object_property_get_qobject(obj, info->name, NULL);
+ info->has_q_default = !!info->q_default;
+ }
entry = g_malloc0(sizeof(*entry));
entry->value = info;
--
2.7.4
next prev parent reply other threads:[~2019-05-17 7:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-17 7:45 [Qemu-devel] [PATCH v3 0/6] numa: deprecate '-numa node, mem' and default memory distribution Igor Mammedov
2019-05-17 7:45 ` [Qemu-devel] [PATCH v3 1/6] pc: fix possible NULL pointer dereference in pc_machine_get_device_memory_region_size() Igor Mammedov
2019-05-27 16:36 ` Markus Armbruster
2019-05-28 13:46 ` Igor Mammedov
2019-05-17 7:45 ` Igor Mammedov [this message]
2019-05-27 18:15 ` [Qemu-devel] [PATCH v3 2/6] qmp: make "qom-list-properties" show initial property values Markus Armbruster
2019-05-17 7:45 ` [Qemu-devel] [PATCH v3 3/6] qmp: qmp_qom_list_properties(): ignore empty string options Igor Mammedov
2019-05-27 18:22 ` Markus Armbruster
2019-05-17 7:45 ` [Qemu-devel] [PATCH v3 4/6] numa: introduce "numa-mem-supported" machine property Igor Mammedov
2019-05-27 18:38 ` Markus Armbruster
2019-05-28 13:14 ` Igor Mammedov
2019-05-27 18:52 ` Eduardo Habkost
2019-05-17 7:45 ` [Qemu-devel] [PATCH v3 5/6] numa: deprecate 'mem' parameter of '-numa node' option Igor Mammedov
2019-05-17 7:45 ` [Qemu-devel] [PATCH v3 6/6] numa: deprecate implict memory distribution between nodes Igor Mammedov
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=1558079119-320634-3-git-send-email-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).