Commit 9316d30fbb429fdb34c60a8ffc164db8b95edf31
Committed by
Anthony Liguori
1 parent
1b524b04
qdev/core: add monitor command to list all drivers
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing
3 changed files
with
14 additions
and
0 deletions
hw/qdev.c
@@ -590,3 +590,14 @@ void do_info_qtree(Monitor *mon) | @@ -590,3 +590,14 @@ void do_info_qtree(Monitor *mon) | ||
590 | if (main_system_bus) | 590 | if (main_system_bus) |
591 | qbus_print(mon, main_system_bus, 0); | 591 | qbus_print(mon, main_system_bus, 0); |
592 | } | 592 | } |
593 | + | ||
594 | +void do_info_qdrv(Monitor *mon) | ||
595 | +{ | ||
596 | + DeviceInfo *info; | ||
597 | + char msg[256]; | ||
598 | + | ||
599 | + for (info = device_info_list; info != NULL; info = info->next) { | ||
600 | + qdev_print_devinfo(info, msg, sizeof(msg)); | ||
601 | + monitor_printf(mon, "%s\n", msg); | ||
602 | + } | ||
603 | +} |
hw/qdev.h
@@ -143,6 +143,7 @@ BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name); | @@ -143,6 +143,7 @@ BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name); | ||
143 | /*** monitor commands ***/ | 143 | /*** monitor commands ***/ |
144 | 144 | ||
145 | void do_info_qtree(Monitor *mon); | 145 | void do_info_qtree(Monitor *mon); |
146 | +void do_info_qdrv(Monitor *mon); | ||
146 | 147 | ||
147 | /*** qdev-properties.c ***/ | 148 | /*** qdev-properties.c ***/ |
148 | 149 |
monitor.c
@@ -1882,6 +1882,8 @@ static const mon_cmd_t info_cmds[] = { | @@ -1882,6 +1882,8 @@ static const mon_cmd_t info_cmds[] = { | ||
1882 | "", "show balloon information" }, | 1882 | "", "show balloon information" }, |
1883 | { "qtree", "", do_info_qtree, | 1883 | { "qtree", "", do_info_qtree, |
1884 | "", "show device tree" }, | 1884 | "", "show device tree" }, |
1885 | + { "qdrv", "", do_info_qdrv, | ||
1886 | + "", "show qdev driver list" }, | ||
1885 | { NULL, NULL, }, | 1887 | { NULL, NULL, }, |
1886 | }; | 1888 | }; |
1887 | 1889 |