@@ -727,6 +727,12 @@ static void do_info_qbus(Monitor *mon, BusState *bus, QObject **ret_data)
*ret_data = (QObject *) qdict;
}
+void do_info_qtree(Monitor *mon, QObject **ret_data)
+{
+ if (main_system_bus)
+ do_info_qbus(mon, main_system_bus, ret_data);
+}
+
#define qdev_printf(fmt, ...) monitor_printf(mon, "%*s" fmt, indent, "", ## __VA_ARGS__)
static void qbus_print(Monitor *mon, BusState *bus, int indent);
@@ -780,8 +786,9 @@ static void qbus_print(Monitor *mon, BusState *bus, int indent)
}
#undef qdev_printf
-void do_info_qtree(Monitor *mon)
+void do_info_qtree_print(Monitor *mon, const QObject *data)
{
+ // TODO: Display qtree from the data!
if (main_system_bus)
qbus_print(mon, main_system_bus, 0);
}
@@ -168,7 +168,8 @@ void qbus_free(BusState *bus);
/*** monitor commands ***/
-void do_info_qtree(Monitor *mon);
+void do_info_qtree(Monitor *mon, QObject **ret_data);
+void do_info_qtree_print(Monitor *mon, const QObject *data);
void do_info_qdm(Monitor *mon);
void do_device_add(Monitor *mon, const QDict *qdict);
void do_device_del(Monitor *mon, const QDict *qdict);
@@ -2607,7 +2607,8 @@ static const mon_cmd_t info_cmds[] = {
.args_type = "",
.params = "",
.help = "show device tree",
- .mhandler.info = do_info_qtree,
+ .user_print = do_info_qtree_print,
+ .mhandler.info_new = do_info_qtree,
},
{
.name = "qdm",
Signed-off-by: Nathan Baum <nathan@parenthephobia.org.uk> --- hw/qdev.c | 9 ++++++++- hw/qdev.h | 3 ++- monitor.c | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-)