@samitouri / QOSamiQemu / commits / 9dbce799e7

qom: Fix device-list-properties & friends to show legacy-FOO props

qmp_device_list_properties() skips properties whose name starts with "legacy-". This is a flawed test for "is a legacy property". The test is flawed because non-legacy properties can and do start with "legacy-". Back when it was added, no such properties existed. Right now, three such properties do: property "legacy-cmb" of device "nvme", and properties "legacy-cache" and "legacy-multi-node" of devices "x86_64-cpu", "i386-cpu", and its children. This affects QMP command "device-list-properties", HMP command "device_add T,help", and command line option "-device T,help". Legacy properties are gone since commit a61383f7ab (qdev: Legacy properties are now unused internally, drop, 2025-10-22). This makes the fix easy: delete the code that skips them. Reproducer: -device nvme,help doesn't show legacy-cmb before the patch, and does after. Fixes: f4eb32b590 (qmp: show QOM properties in device-list-properties, 2014-05-20) Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20260708140948.2622814-1-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Markus Armbruster committed Jul 8, 2026 at 16:09 UTC 9dbce799e7087a75851ba1ae321b22c19b6f75c3
1 file changed -7
qom/qom-qmp-cmds.c
-7
@@ -218,13 +218,6 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,
218 continue;
219 }
220
221 - /* Skip legacy properties since they are just string versions of
222 - * properties that we already list.
223 - */
224 - if (strstart(prop->name, "legacy-", NULL)) {
225 - continue;
226 - }
227 -
221 info = g_new0(ObjectPropertyInfo, 1);
222 info->name = g_strdup(prop->name);
223 info->type = g_strdup(prop->type);