From patchwork Sat Dec 26 21:11:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Baum X-Patchwork-Id: 41812 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 EF08BB7BF8 for ; Sun, 27 Dec 2009 08:29:36 +1100 (EST) Received: from localhost ([127.0.0.1]:44176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NOeCc-0007SB-1h for incoming@patchwork.ozlabs.org; Sat, 26 Dec 2009 16:29:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NOe36-0004GK-4y for qemu-devel@nongnu.org; Sat, 26 Dec 2009 16:19:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NOe2z-0004Bd-9m for qemu-devel@nongnu.org; Sat, 26 Dec 2009 16:19:41 -0500 Received: from [199.232.76.173] (port=43620 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NOe2y-0004BX-Ry for qemu-devel@nongnu.org; Sat, 26 Dec 2009 16:19:36 -0500 Received: from smarthost.c4l.co.uk ([82.197.83.77]:53790) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NOe2y-0005EZ-Da for qemu-devel@nongnu.org; Sat, 26 Dec 2009 16:19:36 -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 1NOe2u-0007uN-Us for qemu-devel@nongnu.org; Sat, 26 Dec 2009 21:19:33 +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 7C1795378B for ; Sat, 26 Dec 2009 21:26:54 +0000 (GMT) Received: by athens (Postfix, from userid 1000) id D728C5EA8F; Sat, 26 Dec 2009 21:11:41 +0000 (GMT) From: Nathan Baum To: qemu-devel@nongnu.org Date: Sat, 26 Dec 2009 21:11:30 +0000 Message-Id: <1261861899-1984-3-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 02/11] qdev: isabus_dev_info returns a QObject detailing the IRQ lines used by the device. 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/isa-bus.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index 4d489d2..b3d599f 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -21,6 +21,8 @@ #include "monitor.h" #include "sysbus.h" #include "isa.h" +#include "qjson.h" +#include "qint.h" struct ISABus { BusState qbus; @@ -143,6 +145,21 @@ static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent) } } +static QObject *isabus_dev_info(Monitor *mon, DeviceState *dev) +{ + ISADevice *d = DO_UPCAST(ISADevice, qdev, dev); + + if (d->isairq[1] != -1) { + return qobject_from_jsonf("{'irq':[%d,%d]}", + d->isairq[0], d->isairq[1]); + } else if (d->isairq[0] != -1) { + return qobject_from_jsonf("{'irq':[%d]}", + d->isairq[0]); + } else { + return qobject_from_jsonf("{'irq':[]}"); + } +} + static int isabus_bridge_init(SysBusDevice *dev) { /* nothing */