qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Maksim Davydov <davydov-max@yandex-team.ru>
To: qemu-devel@nongnu.org
Cc: davydov-max@yandex-team.ru, eduardo@habkost.net,
	marcel.apfelbaum@gmail.com, philmd@linaro.org,
	wangyanan55@huawei.com, jsnow@redhat.com, crosa@redhat.com,
	bleal@redhat.com, eblake@redhat.com, armbru@redhat.com,
	pbonzini@redhat.com, berrange@redhat.com, alxndr@bu.edu,
	bsd@redhat.com, stefanha@redhat.com, thuth@redhat.com,
	darren.kenny@oracle.com, Qiuhao.Li@outlook.com,
	lvivier@redhat.com
Subject: [PATCH v7 1/4] qom: qom-list-properties: add default value
Date: Thu, 14 Dec 2023 18:53:30 +0300	[thread overview]
Message-ID: <20231214155333.35643-2-davydov-max@yandex-team.ru> (raw)
In-Reply-To: <20231214155333.35643-1-davydov-max@yandex-team.ru>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=N, Size: 1071 bytes --]

qmp_qom_list_properties can print default values if they are available
as qmp_device_list_properties does, because both of them use the
ObjectPropertyInfo structure with default_value field. This can be useful
when working with "not device" types (e.g. memory-backend).

Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 qom/qom-qmp-cmds.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c
index 7c087299de..e91a235347 100644
--- a/qom/qom-qmp-cmds.c
+++ b/qom/qom-qmp-cmds.c
@@ -212,6 +212,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename,
         info->name = g_strdup(prop->name);
         info->type = g_strdup(prop->type);
         info->description = g_strdup(prop->description);
+        info->default_value = qobject_ref(prop->defval);
 
         QAPI_LIST_PREPEND(prop_list, info);
     }
-- 
2.34.1



  reply	other threads:[~2023-12-14 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 15:53 [PATCH v7 0/4] compare machine type compat_props Maksim Davydov
2023-12-14 15:53 ` Maksim Davydov [this message]
2023-12-14 15:53 ` [PATCH v7 2/4] qmp: add dump machine type compatibility properties Maksim Davydov
2023-12-14 15:53 ` [PATCH v7 3/4] python/qemu/machine: add method to retrieve QEMUMachine::binary field Maksim Davydov
2023-12-14 15:53 ` [PATCH v7 4/4] scripts: add script to compare compatibility properties Maksim Davydov
2023-12-22 12:51 ` [PATCH v7 0/4] compare machine type compat_props Markus Armbruster
2024-01-08 22:43   ` John Snow

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=20231214155333.35643-2-davydov-max@yandex-team.ru \
    --to=davydov-max@yandex-team.ru \
    --cc=Qiuhao.Li@outlook.com \
    --cc=alxndr@bu.edu \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=bsd@redhat.com \
    --cc=crosa@redhat.com \
    --cc=darren.kenny@oracle.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=jsnow@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wangyanan55@huawei.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).