aboutsummaryrefslogtreecommitdiff
path: root/hw/qxl.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 12:22:06 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:50 -0600
commit40021f08882aaef93c66c8c740087b6d3031b63a (patch)
treea0429c040df66503d807770a3b89da9a0c70d8ac /hw/qxl.c
parent6e4ec3f9bb32d6f41e4fb30b872d2b7b084bc9a9 (diff)
downloadqemu-40021f08882aaef93c66c8c740087b6d3031b63a.zip
qemu-40021f08882aaef93c66c8c740087b6d3031b63a.tar.gz
qemu-40021f08882aaef93c66c8c740087b6d3031b63a.tar.bz2
pci: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qxl.c')
-rw-r--r--hw/qxl.c62
1 files changed, 38 insertions, 24 deletions
diff --git a/hw/qxl.c b/hw/qxl.c
index a00dc33..2f9470f 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1824,32 +1824,46 @@ static Property qxl_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
-static PCIDeviceInfo qxl_primary_info = {
- .qdev.name = "qxl-vga",
- .qdev.desc = "Spice QXL GPU (primary, vga compatible)",
- .qdev.size = sizeof(PCIQXLDevice),
- .qdev.reset = qxl_reset_handler,
- .qdev.vmsd = &qxl_vmstate,
- .no_hotplug = 1,
- .init = qxl_init_primary,
- .romfile = "vgabios-qxl.bin",
- .vendor_id = REDHAT_PCI_VENDOR_ID,
- .device_id = QXL_DEVICE_ID_STABLE,
- .class_id = PCI_CLASS_DISPLAY_VGA,
- .qdev.props = qxl_properties,
+static void qxl_primary_class_init(ObjectClass *klass, void *data)
+{
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+ k->no_hotplug = 1;
+ k->init = qxl_init_primary;
+ k->romfile = "vgabios-qxl.bin";
+ k->vendor_id = REDHAT_PCI_VENDOR_ID;
+ k->device_id = QXL_DEVICE_ID_STABLE;
+ k->class_id = PCI_CLASS_DISPLAY_VGA;
+}
+
+static DeviceInfo qxl_primary_info = {
+ .name = "qxl-vga",
+ .desc = "Spice QXL GPU (primary, vga compatible)",
+ .size = sizeof(PCIQXLDevice),
+ .reset = qxl_reset_handler,
+ .vmsd = &qxl_vmstate,
+ .props = qxl_properties,
+ .class_init = qxl_primary_class_init,
};
-static PCIDeviceInfo qxl_secondary_info = {
- .qdev.name = "qxl",
- .qdev.desc = "Spice QXL GPU (secondary)",
- .qdev.size = sizeof(PCIQXLDevice),
- .qdev.reset = qxl_reset_handler,
- .qdev.vmsd = &qxl_vmstate,
- .init = qxl_init_secondary,
- .vendor_id = REDHAT_PCI_VENDOR_ID,
- .device_id = QXL_DEVICE_ID_STABLE,
- .class_id = PCI_CLASS_DISPLAY_OTHER,
- .qdev.props = qxl_properties,
+static void qxl_secondary_class_init(ObjectClass *klass, void *data)
+{
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+ k->init = qxl_init_secondary;
+ k->vendor_id = REDHAT_PCI_VENDOR_ID;
+ k->device_id = QXL_DEVICE_ID_STABLE;
+ k->class_id = PCI_CLASS_DISPLAY_OTHER;
+}
+
+static DeviceInfo qxl_secondary_info = {
+ .name = "qxl",
+ .desc = "Spice QXL GPU (secondary)",
+ .size = sizeof(PCIQXLDevice),
+ .reset = qxl_reset_handler,
+ .vmsd = &qxl_vmstate,
+ .props = qxl_properties,
+ .class_init = qxl_secondary_class_init,
};
static void qxl_register(void)