From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLZba-0008L9-PA for qemu-devel@nongnu.org; Tue, 30 Jun 2009 05:26:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLZbT-0008Fe-Lb for qemu-devel@nongnu.org; Tue, 30 Jun 2009 05:26:19 -0400 Received: from [199.232.76.173] (port=57910 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLZbS-0008F8-KE for qemu-devel@nongnu.org; Tue, 30 Jun 2009 05:26:14 -0400 Received: from mx2.redhat.com ([66.187.237.31]:44732) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLZbS-0001wJ-5b for qemu-devel@nongnu.org; Tue, 30 Jun 2009 05:26:14 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5U9QDGd006044 for ; Tue, 30 Jun 2009 05:26:13 -0400 From: Gerd Hoffmann Date: Tue, 30 Jun 2009 11:25:59 +0200 Message-Id: <1246353962-32308-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1246353962-32308-1-git-send-email-kraxel@redhat.com> References: <1246353962-32308-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 5/8] qdev/core: add monitor command to list all drivers List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/qdev.c | 10 ++++++++++ hw/qdev.h | 1 + monitor.c | 2 ++ 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index 1fb73b1..768431c 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -419,3 +419,13 @@ void do_info_qbus(Monitor *mon) bus->parent ? bus->parent->info->name : ""); } } + +void do_info_qdrv(Monitor *mon) +{ + DeviceInfo *info; + + for (info = device_info_list; info != NULL; info = info->next) { + monitor_printf(mon, "name \"%s\", bus %s\n", + info->name, info->bus_info->name); + } +} diff --git a/hw/qdev.h b/hw/qdev.h index c4b04c1..2f4e4a4 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -128,5 +128,6 @@ BusState *qbus_find(const char *type, const char *name, int busnr); void do_info_qtree(Monitor *mon); void do_info_qbus(Monitor *mon); +void do_info_qdrv(Monitor *mon); #endif diff --git a/monitor.c b/monitor.c index 39ce99f..5cacfa1 100644 --- a/monitor.c +++ b/monitor.c @@ -1761,6 +1761,8 @@ static const mon_cmd_t info_cmds[] = { "", "show device tree" }, { "qbus", "", do_info_qbus, "", "show qdev bus list" }, + { "qdrv", "", do_info_qdrv, + "", "show qdev driver list" }, { NULL, NULL, }, }; -- 1.6.2.5