aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-10 19:30:32 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-01-24 20:59:15 +0100
commit4f67d30b5e74e060b8dbe10528829b47345cd6e8 (patch)
tree025b44a1cb86fe029ed4c105b2764a13c21c5bba /hw/display
parentb77ade9bb37b2e9813a42008cb21d0c743aa50a1 (diff)
qdev: set properties with device_class_set_props()
The following patch will need to handle properties registration during class_init time. Let's use a device_class_set_props() setter. spatch --macro-file scripts/cocci-macro-file.h --sp-file ./scripts/coccinelle/qdev-set-props.cocci --keep-comments --in-place --dir . @@ typedef DeviceClass; DeviceClass *d; expression val; @@ - d->props = val + device_class_set_props(d, val) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-20-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/ati.c2
-rw-r--r--hw/display/bcm2835_fb.c2
-rw-r--r--hw/display/bochs-display.c2
-rw-r--r--hw/display/cg3.c2
-rw-r--r--hw/display/cirrus_vga.c2
-rw-r--r--hw/display/cirrus_vga_isa.c2
-rw-r--r--hw/display/g364fb.c2
-rw-r--r--hw/display/i2c-ddc.c2
-rw-r--r--hw/display/macfb.c4
-rw-r--r--hw/display/milkymist-vgafb.c2
-rw-r--r--hw/display/qxl.c2
-rw-r--r--hw/display/ramfb-standalone.c2
-rw-r--r--hw/display/sm501.c4
-rw-r--r--hw/display/tcx.c2
-rw-r--r--hw/display/vga-isa.c2
-rw-r--r--hw/display/vga-pci.c4
-rw-r--r--hw/display/vhost-user-gpu.c2
-rw-r--r--hw/display/virtio-gpu-pci.c2
-rw-r--r--hw/display/virtio-gpu.c2
-rw-r--r--hw/display/virtio-vga.c2
-rw-r--r--hw/display/vmware_vga.c2
21 files changed, 24 insertions, 24 deletions
diff --git a/hw/display/ati.c b/hw/display/ati.c
index db3b254316..58ec8291d4 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -980,7 +980,7 @@ static void ati_vga_class_init(ObjectClass *klass, void *data)
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
dc->reset = ati_vga_reset;
- dc->props = ati_vga_properties;
+ device_class_set_props(dc, ati_vga_properties);
dc->hotpluggable = false;
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c
index 85aaa54330..d6bf3374a6 100644
--- a/hw/display/bcm2835_fb.c
+++ b/hw/display/bcm2835_fb.c
@@ -451,7 +451,7 @@ static void bcm2835_fb_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- dc->props = bcm2835_fb_props;
+ device_class_set_props(dc, bcm2835_fb_props);
dc->realize = bcm2835_fb_realize;
dc->reset = bcm2835_fb_reset;
dc->vmsd = &vmstate_bcm2835_fb;
diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
index 215db9a231..62085f9fc0 100644
--- a/hw/display/bochs-display.c
+++ b/hw/display/bochs-display.c
@@ -364,7 +364,7 @@ static void bochs_display_class_init(ObjectClass *klass, void *data)
k->romfile = "vgabios-bochs-display.bin";
k->exit = bochs_display_exit;
dc->vmsd = &vmstate_bochs_display;
- dc->props = bochs_display_properties;
+ device_class_set_props(dc, bochs_display_properties);
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
}
diff --git a/hw/display/cg3.c b/hw/display/cg3.c
index f90baae4de..4fb67c6b1c 100644
--- a/hw/display/cg3.c
+++ b/hw/display/cg3.c
@@ -382,7 +382,7 @@ static void cg3_class_init(ObjectClass *klass, void *data)
dc->realize = cg3_realizefn;
dc->reset = cg3_reset;
dc->vmsd = &vmstate_cg3;
- dc->props = cg3_properties;
+ device_class_set_props(dc, cg3_properties);
}
static const TypeInfo cg3_info = {
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index cd283e53b4..0d391e1300 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -3031,7 +3031,7 @@ static void cirrus_vga_class_init(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
dc->desc = "Cirrus CLGD 54xx VGA";
dc->vmsd = &vmstate_pci_cirrus_vga;
- dc->props = pci_vga_cirrus_properties;
+ device_class_set_props(dc, pci_vga_cirrus_properties);
dc->hotpluggable = false;
}
diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c
index 7ef8e59224..825ba57298 100644
--- a/hw/display/cirrus_vga_isa.c
+++ b/hw/display/cirrus_vga_isa.c
@@ -80,7 +80,7 @@ static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data)
dc->vmsd = &vmstate_cirrus_vga;
dc->realize = isa_cirrus_vga_realizefn;
- dc->props = isa_cirrus_vga_properties;
+ device_class_set_props(dc, isa_cirrus_vga_properties);
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
}
diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c
index 839d26eca1..55185c95c6 100644
--- a/hw/display/g364fb.c
+++ b/hw/display/g364fb.c
@@ -526,7 +526,7 @@ static void g364fb_sysbus_class_init(ObjectClass *klass, void *data)
dc->desc = "G364 framebuffer";
dc->reset = g364fb_sysbus_reset;
dc->vmsd = &vmstate_g364fb;
- dc->props = g364fb_sysbus_properties;
+ device_class_set_props(dc, g364fb_sysbus_properties);
}
static const TypeInfo g364fb_sysbus_info = {
diff --git a/hw/display/i2c-ddc.c b/hw/display/i2c-ddc.c
index fc70b7930c..13eb529fc1 100644
--- a/hw/display/i2c-ddc.c
+++ b/hw/display/i2c-ddc.c
@@ -107,7 +107,7 @@ static void i2c_ddc_class_init(ObjectClass *oc, void *data)
dc->reset = i2c_ddc_reset;
dc->vmsd = &vmstate_i2c_ddc;
- dc->props = i2c_ddc_properties;
+ device_class_set_props(dc, i2c_ddc_properties);
isc->event = i2c_ddc_event;
isc->recv = i2c_ddc_rx;
isc->send = i2c_ddc_tx;
diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index f4fa8e3206..8bff16d535 100644
--- a/hw/display/macfb.c
+++ b/hw/display/macfb.c
@@ -437,7 +437,7 @@ static void macfb_sysbus_class_init(ObjectClass *klass, void *data)
dc->desc = "SysBus Macintosh framebuffer";
dc->reset = macfb_sysbus_reset;
dc->vmsd = &vmstate_macfb;
- dc->props = macfb_sysbus_properties;
+ device_class_set_props(dc, macfb_sysbus_properties);
}
static void macfb_nubus_class_init(ObjectClass *klass, void *data)
@@ -450,7 +450,7 @@ static void macfb_nubus_class_init(ObjectClass *klass, void *data)
dc->desc = "Nubus Macintosh framebuffer";
dc->reset = macfb_nubus_reset;
dc->vmsd = &vmstate_macfb;
- dc->props = macfb_nubus_properties;
+ device_class_set_props(dc, macfb_nubus_properties);
}
static TypeInfo macfb_sysbus_info = {
diff --git a/hw/display/milkymist-vgafb.c b/hw/display/milkymist-vgafb.c
index 8b0da4660a..6a6441e6ea 100644
--- a/hw/display/milkymist-vgafb.c
+++ b/hw/display/milkymist-vgafb.c
@@ -341,7 +341,7 @@ static void milkymist_vgafb_class_init(ObjectClass *klass, void *data)
dc->reset = milkymist_vgafb_reset;
dc->vmsd = &vmstate_milkymist_vgafb;
- dc->props = milkymist_vgafb_properties;
+ device_class_set_props(dc, milkymist_vgafb_properties);
dc->realize = milkymist_vgafb_realize;
}
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 6d43b7433c..944c02ce56 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2478,7 +2478,7 @@ static void qxl_pci_class_init(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
dc->reset = qxl_reset_handler;
dc->vmsd = &qxl_vmstate;
- dc->props = qxl_properties;
+ device_class_set_props(dc, qxl_properties);
}
static const TypeInfo qxl_pci_type_info = {
diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c
index 1f72450303..d76a9d0fe2 100644
--- a/hw/display/ramfb-standalone.c
+++ b/hw/display/ramfb-standalone.c
@@ -52,7 +52,7 @@ static void ramfb_class_initfn(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
dc->realize = ramfb_realizefn;
- dc->props = ramfb_properties;
+ device_class_set_props(dc, ramfb_properties);
dc->desc = "ram framebuffer standalone device";
dc->user_creatable = true;
}
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 66a1bfbe60..de0ab9d977 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1995,7 +1995,7 @@ static void sm501_sysbus_class_init(ObjectClass *klass, void *data)
dc->realize = sm501_realize_sysbus;
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
dc->desc = "SM501 Multimedia Companion";
- dc->props = sm501_sysbus_properties;
+ device_class_set_props(dc, sm501_sysbus_properties);
dc->reset = sm501_reset_sysbus;
dc->vmsd = &vmstate_sm501_sysbus;
}
@@ -2085,7 +2085,7 @@ static void sm501_pci_class_init(ObjectClass *klass, void *data)
k->class_id = PCI_CLASS_DISPLAY_OTHER;
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
dc->desc = "SM501 Display Controller";
- dc->props = sm501_pci_properties;
+ device_class_set_props(dc, sm501_pci_properties);
dc->reset = sm501_reset_pci;
dc->hotpluggable = false;
dc->vmsd = &vmstate_sm501_pci;
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index abbeb30284..ca458f94fe 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -893,7 +893,7 @@ static void tcx_class_init(ObjectClass *klass, void *data)
dc->realize = tcx_realizefn;
dc->reset = tcx_reset;
dc->vmsd = &vmstate_tcx;
- dc->props = tcx_properties;
+ device_class_set_props(dc, tcx_properties);
}
static const TypeInfo tcx_info = {
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
index 08a2730db5..0633ed382c 100644
--- a/hw/display/vga-isa.c
+++ b/hw/display/vga-isa.c
@@ -95,7 +95,7 @@ static void vga_isa_class_initfn(ObjectClass *klass, void *data)
dc->realize = vga_isa_realizefn;
dc->reset = vga_isa_reset;
dc->vmsd = &vmstate_vga_common;
- dc->props = vga_isa_properties;
+ device_class_set_props(dc, vga_isa_properties);
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
}
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index cfe095713e..b346324673 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -383,7 +383,7 @@ static void vga_class_init(ObjectClass *klass, void *data)
k->realize = pci_std_vga_realize;
k->romfile = "vgabios-stdvga.bin";
k->class_id = PCI_CLASS_DISPLAY_VGA;
- dc->props = vga_pci_properties;
+ device_class_set_props(dc, vga_pci_properties);
dc->hotpluggable = false;
}
@@ -395,7 +395,7 @@ static void secondary_class_init(ObjectClass *klass, void *data)
k->realize = pci_secondary_vga_realize;
k->exit = pci_secondary_vga_exit;
k->class_id = PCI_CLASS_DISPLAY_OTHER;
- dc->props = secondary_pci_properties;
+ device_class_set_props(dc, secondary_pci_properties);
dc->reset = pci_secondary_vga_reset;
}
diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index 279877886e..f0c7c6fb9a 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -588,7 +588,7 @@ vhost_user_gpu_class_init(ObjectClass *klass, void *data)
vdc->get_config = vhost_user_gpu_get_config;
vdc->set_config = vhost_user_gpu_set_config;
- dc->props = vhost_user_gpu_properties;
+ device_class_set_props(dc, vhost_user_gpu_properties);
}
static const TypeInfo vhost_user_gpu_info = {
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index 25e4038874..3d152ff5c8 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -56,7 +56,7 @@ static void virtio_gpu_pci_base_class_init(ObjectClass *klass, void *data)
PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
- dc->props = virtio_gpu_pci_base_properties;
+ device_class_set_props(dc, virtio_gpu_pci_base_properties);
dc->hotpluggable = false;
k->realize = virtio_gpu_pci_base_realize;
pcidev_k->class_id = PCI_CLASS_DISPLAY_OTHER;
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 28e868c021..5f0dd7c150 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1254,7 +1254,7 @@ static void virtio_gpu_class_init(ObjectClass *klass, void *data)
vdc->set_config = virtio_gpu_set_config;
dc->vmsd = &vmstate_virtio_gpu;
- dc->props = virtio_gpu_properties;
+ device_class_set_props(dc, virtio_gpu_properties);
}
static const TypeInfo virtio_gpu_info = {
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index cc6e66ea1c..2b4c2aa126 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -184,7 +184,7 @@ static void virtio_vga_base_class_init(ObjectClass *klass, void *data)
PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
- dc->props = virtio_vga_base_properties;
+ device_class_set_props(dc, virtio_vga_base_properties);
dc->vmsd = &vmstate_virtio_vga_base;
dc->hotpluggable = false;
device_class_set_parent_reset(dc, virtio_vga_base_reset,
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index ead754eccf..58ea82e3e5 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -1336,7 +1336,7 @@ static void vmsvga_class_init(ObjectClass *klass, void *data)
k->subsystem_id = SVGA_PCI_DEVICE_ID;
dc->reset = vmsvga_reset;
dc->vmsd = &vmstate_vmware_vga;
- dc->props = vga_vmware_properties;
+ device_class_set_props(dc, vga_vmware_properties);
dc->hotpluggable = false;
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
}