diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-10 19:30:32 +0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-01-24 20:59:15 +0100 |
commit | 4f67d30b5e74e060b8dbe10528829b47345cd6e8 (patch) | |
tree | 025b44a1cb86fe029ed4c105b2764a13c21c5bba /hw/block | |
parent | b77ade9bb37b2e9813a42008cb21d0c743aa50a1 (diff) | |
download | qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.zip qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.tar.gz qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.tar.bz2 |
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/block')
-rw-r--r-- | hw/block/fdc.c | 8 | ||||
-rw-r--r-- | hw/block/m25p80.c | 2 | ||||
-rw-r--r-- | hw/block/nand.c | 2 | ||||
-rw-r--r-- | hw/block/nvme.c | 2 | ||||
-rw-r--r-- | hw/block/onenand.c | 2 | ||||
-rw-r--r-- | hw/block/pflash_cfi01.c | 2 | ||||
-rw-r--r-- | hw/block/pflash_cfi02.c | 2 | ||||
-rw-r--r-- | hw/block/swim.c | 2 | ||||
-rw-r--r-- | hw/block/vhost-user-blk.c | 2 | ||||
-rw-r--r-- | hw/block/virtio-blk.c | 2 | ||||
-rw-r--r-- | hw/block/xen-block.c | 2 |
11 files changed, 14 insertions, 14 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c index ac5d31e..22e954e 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -606,7 +606,7 @@ static void floppy_drive_class_init(ObjectClass *klass, void *data) k->realize = floppy_drive_realize; set_bit(DEVICE_CATEGORY_STORAGE, k->categories); k->bus_type = TYPE_FLOPPY_BUS; - k->props = floppy_drive_properties; + device_class_set_props(k, floppy_drive_properties); k->desc = "virtual floppy drive"; } @@ -2827,7 +2827,7 @@ static void isabus_fdc_class_init(ObjectClass *klass, void *data) dc->fw_name = "fdc"; dc->reset = fdctrl_external_reset_isa; dc->vmsd = &vmstate_isa_fdc; - dc->props = isa_fdc_properties; + device_class_set_props(dc, isa_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } @@ -2880,7 +2880,7 @@ static void sysbus_fdc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = sysbus_fdc_properties; + device_class_set_props(dc, sysbus_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } @@ -2906,7 +2906,7 @@ static void sun4m_fdc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = sun4m_fdc_properties; + device_class_set_props(dc, sun4m_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 11ff5b9..61f2fb8 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -1391,7 +1391,7 @@ static void m25p80_class_init(ObjectClass *klass, void *data) k->set_cs = m25p80_cs; k->cs_polarity = SSI_CS_LOW; dc->vmsd = &vmstate_m25p80; - dc->props = m25p80_properties; + device_class_set_props(dc, m25p80_properties); dc->reset = m25p80_reset; mc->pi = data; } diff --git a/hw/block/nand.c b/hw/block/nand.c index e396004..bba8968 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -448,7 +448,7 @@ static void nand_class_init(ObjectClass *klass, void *data) dc->realize = nand_realize; dc->reset = nand_reset; dc->vmsd = &vmstate_nand; - dc->props = nand_properties; + device_class_set_props(dc, nand_properties); } static const TypeInfo nand_info = { diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 12d8254..d28335c 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1475,7 +1475,7 @@ static void nvme_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->desc = "Non-Volatile Memory Express"; - dc->props = nvme_props; + device_class_set_props(dc, nvme_props); dc->vmsd = &nvme_vmstate; } diff --git a/hw/block/onenand.c b/hw/block/onenand.c index 9c233c1..898ac56 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -845,7 +845,7 @@ static void onenand_class_init(ObjectClass *klass, void *data) dc->realize = onenand_realize; dc->reset = onenand_system_reset; - dc->props = onenand_properties; + device_class_set_props(dc, onenand_properties); } static const TypeInfo onenand_info = { diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index 54e6ebd..24f3bce 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -930,7 +930,7 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data) dc->reset = pflash_cfi01_system_reset; dc->realize = pflash_cfi01_realize; - dc->props = pflash_cfi01_properties; + device_class_set_props(dc, pflash_cfi01_properties); dc->vmsd = &vmstate_pflash; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index c7d92c3..7c4744c 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -963,7 +963,7 @@ static void pflash_cfi02_class_init(ObjectClass *klass, void *data) dc->realize = pflash_cfi02_realize; dc->unrealize = pflash_cfi02_unrealize; - dc->props = pflash_cfi02_properties; + device_class_set_props(dc, pflash_cfi02_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/block/swim.c b/hw/block/swim.c index c6d117e..8f12478 100644 --- a/hw/block/swim.c +++ b/hw/block/swim.c @@ -239,7 +239,7 @@ static void swim_drive_class_init(ObjectClass *klass, void *data) k->realize = swim_drive_realize; set_bit(DEVICE_CATEGORY_STORAGE, k->categories); k->bus_type = TYPE_SWIM_BUS; - k->props = swim_drive_properties; + device_class_set_props(k, swim_drive_properties); k->desc = "virtual SWIM drive"; } diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 98b383f..d8c459c 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -511,7 +511,7 @@ static void vhost_user_blk_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = vhost_user_blk_properties; + device_class_set_props(dc, vhost_user_blk_properties); dc->vmsd = &vmstate_vhost_user_blk; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = vhost_user_blk_device_realize; diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 9bee514..09f46ed 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1294,7 +1294,7 @@ static void virtio_blk_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_blk_properties; + device_class_set_props(dc, virtio_blk_properties); dc->vmsd = &vmstate_virtio_blk; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = virtio_blk_device_realize; diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 879fc31..686bbc3 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -554,7 +554,7 @@ static void xen_block_class_init(ObjectClass *class, void *data) xendev_class->frontend_changed = xen_block_frontend_changed; xendev_class->unrealize = xen_block_unrealize; - dev_class->props = xen_block_props; + device_class_set_props(dev_class, xen_block_props); } static const TypeInfo xen_block_type_info = { |