From patchwork Sat Dec 26 21:11:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Baum X-Patchwork-Id: 41823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5BC2DB7BFA for ; Sun, 27 Dec 2009 08:52:22 +1100 (EST) Received: from localhost ([127.0.0.1]:54876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NOeYd-0007KG-3f for incoming@patchwork.ozlabs.org; Sat, 26 Dec 2009 16:52:19 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NOe3C-0004Jo-Bv for qemu-devel@nongnu.org; Sat, 26 Dec 2009 16:19:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NOe34-0004Ex-W7 for qemu-devel@nongnu.org; Sat, 26 Dec 2009 16:19:47 -0500 Received: from [199.232.76.173] (port=43627 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NOe32-0004ED-LV for qemu-devel@nongnu.org; Sat, 26 Dec 2009 16:19:40 -0500 Received: from smarthost.c4l.co.uk ([82.197.83.77]:53797) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NOe32-0005F7-7d for qemu-devel@nongnu.org; Sat, 26 Dec 2009 16:19:40 -0500 Received: from [93.97.162.229] (helo=mx.parenthephobia.org.uk) by smarthost.c4l.co.uk with esmtp (Exim 4.69) (envelope-from ) id 1NOe2w-0007uO-D9 for qemu-devel@nongnu.org; Sat, 26 Dec 2009 21:19:35 +0000 Received: from athens (93-97-162-231.zone5.bethere.co.uk [93.97.162.231]) by mx.parenthephobia.org.uk (Postfix) with ESMTP id 961BB53792 for ; Sat, 26 Dec 2009 21:26:56 +0000 (GMT) Received: by athens (Postfix, from userid 1000) id 1BED85EAB8; Sat, 26 Dec 2009 21:11:42 +0000 (GMT) From: Nathan Baum To: qemu-devel@nongnu.org Date: Sat, 26 Dec 2009 21:11:39 +0000 Message-Id: <1261861899-1984-12-git-send-email-nathan@parenthephobia.org.uk> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1261861899-1984-1-git-send-email-nathan@parenthephobia.org.uk> References: <1261861899-1984-1-git-send-email-nathan@parenthephobia.org.uk> X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [RFC, PATCH 11/11] Change the monitor to use the new do_info_qtree. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Nathan Baum --- hw/qdev.c | 9 ++++++++- hw/qdev.h | 3 ++- monitor.c | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index f5d68c6..d9d3778 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -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); } diff --git a/hw/qdev.h b/hw/qdev.h index 93467a5..aad4f75 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -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); diff --git a/monitor.c b/monitor.c index e6b5424..8d5b650 100644 --- a/monitor.c +++ b/monitor.c @@ -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",