]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qom: add default value
authorMaksim Davydov <davydov-max@yandex-team.ru>
Mon, 18 Mar 2024 21:35:47 +0000 (00:35 +0300)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 25 Apr 2024 08:12:35 +0000 (10:12 +0200)
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>
Message-ID: <20240318213550.155573-2-davydov-max@yandex-team.ru>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
qom/qom-qmp-cmds.c

index 7c087299de9eba5d0bed7e156338e65866bf8832..e91a2353472a54dac852494a27a037228134bce8 100644 (file)
@@ -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);
     }