[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/11] qdev: isabus_dev_info returns a QObject detai
From: |
Nathan Baum |
Subject: |
[Qemu-devel] [PATCH 02/11] qdev: isabus_dev_info returns a QObject detailing the IRQ lines used by the device. |
Date: |
Sat, 26 Dec 2009 21:19:13 +0000 |
Signed-off-by: Nathan Baum <address@hidden>
---
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 */
--
1.6.3.3
- [Qemu-devel] [RFC,PATCH 00/11] Half-convert info qtree to QMP., Nathan Baum, 2009/12/26
- [Qemu-devel] [PATCH 02/11] qdev: isabus_dev_info returns a QObject detailing the IRQ lines used by the device.,
Nathan Baum <=
- [Qemu-devel] [PATCH 01/11] Add info_dev function pointer for BusInfo., Nathan Baum, 2009/12/26
- [Qemu-devel] [PATCH 05/11] qdev: Add pcibus_dev_info to pci_bus_info, Nathan Baum, 2009/12/26
- [Qemu-devel] [PATCH 06/11] qdev: sysbus_dev_info, Nathan Baum, 2009/12/26
- [Qemu-devel] [PATCH 03/11] qdev: Add isabuf_dev_info to ISA's BusInfo struct., Nathan Baum, 2009/12/26
- [Qemu-devel] [PATCH 07/11] qdev: Add sysbus_dev_info to system_bus_info, Nathan Baum, 2009/12/26
- [Qemu-devel] [PATCH 08/11] qdev: Add usb_bus_dev_info, Nathan Baum, 2009/12/26
- [Qemu-devel] [PATCH 04/11] qdev: pcibus_dev_info, Nathan Baum, 2009/12/26