@@ -780,13 +780,36 @@ void do_info_qtree(Monitor *mon)
qbus_print(mon, main_system_bus, 0);
}
-void do_info_qdm(Monitor *mon)
+static void qdm_list_iter(QObject *obj, void *opaque)
{
- DeviceInfo *info;
- for (info = device_info_list; info != NULL; info = info->next) {
- qdev_print_devinfo(info);
+ Monitor *mon = opaque;
+ QDict *dev = qobject_to_qdict(obj);
+
+ monitor_printf(mon, "name \"%s\", bus %s", qdict_get_str(dev, "name"),
+ qdict_get_str(dev, "bus"));
+
+ if (qdict_haskey(dev, "alias")) {
+ monitor_printf(mon, ", alias \"%s\"", qdict_get_str(dev, "alias"));
}
+
+ if (qdict_haskey(dev, "description")) {
+ monitor_printf(mon, ", desc \"%s\"", qdict_get_str(dev, "description"));
+ }
+
+ if (!qdict_get_bool(dev, "creatable")) {
+ monitor_printf(mon, ", no-user");
+ }
+
+ monitor_printf(mon, "\n");
+}
+
+void do_info_qdm_print(Monitor *mon, const QObject *ret_data)
+{
+ QList *devs;
+
+ devs = qobject_to_qlist(ret_data);
+ qlist_iter(devs, qdm_list_iter, mon);
}
static const char *qdev_property_type_to_string(int type)
@@ -184,7 +184,7 @@ void qbus_free(BusState *bus);
/*** monitor commands ***/
void do_info_qtree(Monitor *mon);
-void do_info_qdm(Monitor *mon);
+void do_info_qdm_print(Monitor *mon, const QObject *ret_data);
void do_available_devices(Monitor *mon, QObject **ret_data);
int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
int do_device_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
@@ -2573,7 +2573,8 @@ static const mon_cmd_t info_cmds[] = {
.args_type = "",
.params = "",
.help = "show qdev device model list",
- .mhandler.info = do_info_qdm,
+ .user_print = do_info_qdm_print,
+ .mhandler.info_new = do_available_devices,
},
{
.name = "roms",