[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/29] pci: add qom property for PCIBus instances
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 09/29] pci: add qom property for PCIBus instances |
Date: |
Thu, 1 Nov 2012 08:04:11 -0500 |
Signed-off-by: Michael Roth <address@hidden>
---
hw/pci.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/hw/pci.c b/hw/pci.c
index 271ca2f..e0b3f4f 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -34,6 +34,7 @@
#include "msi.h"
#include "msix.h"
#include "exec-memory.h"
+#include "qidl.h"
QIDL_ENABLE()
@@ -268,6 +269,22 @@ int pci_find_domain(const PCIBus *bus)
return -1;
}
+static void pcibus_get_state(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ PCIBus *pci_bus = PCI_BUS(obj);
+
+ QIDL_VISIT_TYPE(PCIBus, v, &pci_bus, name, errp);
+}
+
+static void pcibus_set_state(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ PCIBus *pci_bus = PCI_BUS(obj);
+
+ QIDL_VISIT_TYPE(PCIBus, v, &pci_bus, name, errp);
+}
+
void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent,
const char *name,
MemoryRegion *address_space_mem,
@@ -285,6 +302,10 @@ void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent,
pci_host_bus_register(0, bus); /* for now only pci domain 0 is supported */
vmstate_register(NULL, -1, &vmstate_pcibus, bus);
+
+ object_property_add(OBJECT(bus), "state", "PCIBus",
+ pcibus_get_state, pcibus_set_state, NULL, NULL, NULL);
+ QIDL_SCHEMA_ADD_LINK(PCIBus, OBJECT(bus), "state_schema", NULL);
}
PCIBus *pci_bus_new(DeviceState *parent, const char *name,
--
1.7.9.5
- [Qemu-devel] [PATCH 04/29] rtc: qidl_declare RTCState, (continued)
- [Qemu-devel] [PATCH 04/29] rtc: qidl_declare RTCState, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 06/29] rtc: add qom property for RTCState state, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 10/29] vga: qidl_declare VGACommonState, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 13/29] cirrus: qidl_declare ISACirrusVGAState, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 15/29] i440fx: qidl_declare PCII440FXState, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 14/29] cirrus: add qom property for isa-cirrus-vga, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 29/29] hpet: add qom property for hpet state, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 27/29] ide: add qom property for piix3/piix4-ide state, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 22/29] pci_bridge_dev: add qom property for pci-bridge state, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 23/29] ide: qidl_declare IDEBus + IDEState + IDEDevice, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 09/29] pci: add qom property for PCIBus instances,
Michael Roth <=
- [Qemu-devel] [PATCH 07/29] pci: qidl_declare PCIDevice + PCIBus, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 05/29] rtc: use qidl-generated properties, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 21/29] pci_bridge_dev: qidl_declare PCIBridgeDev, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 17/29] piix3: qidl_declare PIIX3State, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 25/29] ide: add qom property for isa-ide state, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 18/29] piix3: add qom property for PIIX3 state, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 19/29] shpc: qidl_declare SHPCDevice, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 26/29] ide: qidl_declare BMDMAState + PCIIDEState, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 24/29] ide: qidl_declare ISAIDEState, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 16/29] i440fx: a qom property for i440FX state, Michael Roth, 2012/11/01