[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/29] cirrus: add qom property for cirrus-vga state
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 12/29] cirrus: add qom property for cirrus-vga state |
Date: |
Thu, 1 Nov 2012 08:04:14 -0500 |
Signed-off-by: Michael Roth <address@hidden>
---
hw/cirrus_vga.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index f9c8b46..9b27317 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -33,6 +33,8 @@
#include "loader.h"
#include "qidl.h"
+QIDL_ENABLE()
+
/*
* TODO:
* - destination write mask support not complete (bits 5..7)
@@ -2939,6 +2941,23 @@ static TypeInfo isa_cirrus_vga_info = {
*
***************************************/
+static void pci_cirrus_vga_get_state(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ PCIDevice *pci = PCI_DEVICE(obj);
+ PCICirrusVGAState *s = DO_UPCAST(PCICirrusVGAState, dev, pci);
+ QIDL_VISIT_TYPE(PCICirrusVGAState, v, &s, name, errp);
+}
+
+static void pci_cirrus_vga_set_state(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ PCIDevice *pci = PCI_DEVICE(obj);
+ PCICirrusVGAState *s = DO_UPCAST(PCICirrusVGAState, dev, pci);
+ QIDL_VISIT_TYPE(PCICirrusVGAState, v, &s, name, errp);
+ cirrus_post_load(&s->cirrus_vga, -1);
+}
+
static int pci_cirrus_vga_initfn(PCIDevice *dev)
{
PCICirrusVGAState *d = DO_UPCAST(PCICirrusVGAState, dev, dev);
@@ -2971,6 +2990,11 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
if (device_id == CIRRUS_ID_CLGD5446) {
pci_register_bar(&d->dev, 1, 0, &s->cirrus_mmio_io);
}
+
+ object_property_add(OBJECT(d), "state", "PCICirrusVGAState",
+ pci_cirrus_vga_get_state, pci_cirrus_vga_set_state,
+ NULL, NULL, NULL);
+ QIDL_SCHEMA_ADD_LINK(PCICirrusVGAState, OBJECT(d), "state_schema", NULL);
return 0;
}
--
1.7.9.5
- [Qemu-devel] [PATCH 07/29] pci: qidl_declare PCIDevice + PCIBus, (continued)
- [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
- [Qemu-devel] [PATCH 12/29] cirrus: add qom property for cirrus-vga state,
Michael Roth <=
- [Qemu-devel] [PATCH 20/29] pci_bridge: qidl_declare PCIBridge, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 11/29] cirrus: qidl_declare PCICirrusVGAState + CirrusVGAState, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 28/29] hpet: qidl_declare HPETState + HPETTimer, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 03/29] isa: qidl_declare ISADevice, Michael Roth, 2012/11/01
- [Qemu-devel] [PATCH 08/29] pci: use qidl_declare'd properties for TYPE_PCI_DEVICE, Michael Roth, 2012/11/01