From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLGFt-0006Ny-Un for qemu-devel@nongnu.org; Mon, 29 Jun 2009 08:46:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLGFo-0006J1-EF for qemu-devel@nongnu.org; Mon, 29 Jun 2009 08:46:40 -0400 Received: from [199.232.76.173] (port=41118 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLGFn-0006Ic-Vs for qemu-devel@nongnu.org; Mon, 29 Jun 2009 08:46:36 -0400 Received: from mx2.redhat.com ([66.187.237.31]:36449) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLGFn-0003qT-Er for qemu-devel@nongnu.org; Mon, 29 Jun 2009 08:46:35 -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 n5TCkYla007030 for ; Mon, 29 Jun 2009 08:46:34 -0400 From: Gerd Hoffmann Date: Mon, 29 Jun 2009 14:46:06 +0200 Message-Id: <1246279581-15749-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1246279581-15749-1-git-send-email-kraxel@redhat.com> References: <1246279581-15749-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 05/20] 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 b1da695..b91fef6 100644 --- a/monitor.c +++ b/monitor.c @@ -1743,6 +1743,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