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/virtio | |
parent | b77ade9bb37b2e9813a42008cb21d0c743aa50a1 (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/virtio')
-rw-r--r-- | hw/virtio/vhost-scsi-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/vhost-user-blk-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/vhost-user-fs-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/vhost-user-fs.c | 2 | ||||
-rw-r--r-- | hw/virtio/vhost-user-scsi-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/vhost-vsock-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/vhost-vsock.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-9p-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-balloon-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-balloon.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-blk-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-crypto-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-crypto.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-input-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-mmio.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-net-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-pci.c | 4 | ||||
-rw-r--r-- | hw/virtio/virtio-pmem.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-rng.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-scsi-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-serial-pci.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio.c | 2 |
22 files changed, 23 insertions, 23 deletions
diff --git a/hw/virtio/vhost-scsi-pci.c b/hw/virtio/vhost-scsi-pci.c index e8dfbfc60f..5dce640eaf 100644 --- a/hw/virtio/vhost-scsi-pci.c +++ b/hw/virtio/vhost-scsi-pci.c @@ -64,7 +64,7 @@ static void vhost_scsi_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = vhost_scsi_pci_realize; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = vhost_scsi_pci_properties; + device_class_set_props(dc, vhost_scsi_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_SCSI; pcidev_k->revision = 0x00; diff --git a/hw/virtio/vhost-user-blk-pci.c b/hw/virtio/vhost-user-blk-pci.c index 1dc834a3ff..8d3d766427 100644 --- a/hw/virtio/vhost-user-blk-pci.c +++ b/hw/virtio/vhost-user-blk-pci.c @@ -69,7 +69,7 @@ static void vhost_user_blk_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = vhost_user_blk_pci_properties; + device_class_set_props(dc, vhost_user_blk_pci_properties); k->realize = vhost_user_blk_pci_realize; pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BLOCK; diff --git a/hw/virtio/vhost-user-fs-pci.c b/hw/virtio/vhost-user-fs-pci.c index e3a649d4a6..ae36f1172d 100644 --- a/hw/virtio/vhost-user-fs-pci.c +++ b/hw/virtio/vhost-user-fs-pci.c @@ -55,7 +55,7 @@ static void vhost_user_fs_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = vhost_user_fs_pci_realize; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = vhost_user_fs_pci_properties; + device_class_set_props(dc, vhost_user_fs_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = 0; /* Set by virtio-pci based on virtio id */ pcidev_k->revision = 0x00; diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c index ca0b7fc9de..33b17848c2 100644 --- a/hw/virtio/vhost-user-fs.c +++ b/hw/virtio/vhost-user-fs.c @@ -271,7 +271,7 @@ static void vuf_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = vuf_properties; + device_class_set_props(dc, vuf_properties); dc->vmsd = &vuf_vmstate; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = vuf_device_realize; diff --git a/hw/virtio/vhost-user-scsi-pci.c b/hw/virtio/vhost-user-scsi-pci.c index ff13af7030..32febb2daa 100644 --- a/hw/virtio/vhost-user-scsi-pci.c +++ b/hw/virtio/vhost-user-scsi-pci.c @@ -70,7 +70,7 @@ static void vhost_user_scsi_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = vhost_user_scsi_pci_realize; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = vhost_user_scsi_pci_properties; + device_class_set_props(dc, vhost_user_scsi_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_SCSI; pcidev_k->revision = 0x00; diff --git a/hw/virtio/vhost-vsock-pci.c b/hw/virtio/vhost-vsock-pci.c index 4ca097ffff..01effe3d52 100644 --- a/hw/virtio/vhost-vsock-pci.c +++ b/hw/virtio/vhost-vsock-pci.c @@ -55,7 +55,7 @@ static void vhost_vsock_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = vhost_vsock_pci_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = vhost_vsock_pci_properties; + device_class_set_props(dc, vhost_vsock_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_VSOCK; pcidev_k->revision = 0x00; diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c index f5744363a8..87c45d81f6 100644 --- a/hw/virtio/vhost-vsock.c +++ b/hw/virtio/vhost-vsock.c @@ -393,7 +393,7 @@ static void vhost_vsock_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = vhost_vsock_properties; + device_class_set_props(dc, vhost_vsock_properties); dc->vmsd = &vmstate_virtio_vhost_vsock; set_bit(DEVICE_CATEGORY_MISC, dc->categories); vdc->realize = vhost_vsock_device_realize; diff --git a/hw/virtio/virtio-9p-pci.c b/hw/virtio/virtio-9p-pci.c index 22a183cca7..6507ce340b 100644 --- a/hw/virtio/virtio-9p-pci.c +++ b/hw/virtio/virtio-9p-pci.c @@ -61,7 +61,7 @@ static void virtio_9p_pci_class_init(ObjectClass *klass, void *data) pcidev_k->revision = VIRTIO_PCI_ABI_VERSION; pcidev_k->class_id = 0x2; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = virtio_9p_pci_properties; + device_class_set_props(dc, virtio_9p_pci_properties); } static void virtio_9p_pci_instance_init(Object *obj) diff --git a/hw/virtio/virtio-balloon-pci.c b/hw/virtio/virtio-balloon-pci.c index 69ca057911..56962aeb43 100644 --- a/hw/virtio/virtio-balloon-pci.c +++ b/hw/virtio/virtio-balloon-pci.c @@ -59,7 +59,7 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = virtio_balloon_pci_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = virtio_balloon_pci_properties; + device_class_set_props(dc, virtio_balloon_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON; pcidev_k->revision = VIRTIO_PCI_ABI_VERSION; diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 57f3b9f22d..a4729f7fc9 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -932,7 +932,7 @@ static void virtio_balloon_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_balloon_properties; + device_class_set_props(dc, virtio_balloon_properties); dc->vmsd = &vmstate_virtio_balloon; set_bit(DEVICE_CATEGORY_MISC, dc->categories); vdc->realize = virtio_balloon_device_realize; diff --git a/hw/virtio/virtio-blk-pci.c b/hw/virtio/virtio-blk-pci.c index d9b69a5af3..efb2c22a1d 100644 --- a/hw/virtio/virtio-blk-pci.c +++ b/hw/virtio/virtio-blk-pci.c @@ -66,7 +66,7 @@ static void virtio_blk_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = virtio_blk_pci_properties; + device_class_set_props(dc, virtio_blk_pci_properties); k->realize = virtio_blk_pci_realize; pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BLOCK; diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c index d853dc460c..0bebe0149d 100644 --- a/hw/virtio/virtio-crypto-pci.c +++ b/hw/virtio/virtio-crypto-pci.c @@ -69,7 +69,7 @@ static void virtio_crypto_pci_class_init(ObjectClass *klass, void *data) k->realize = virtio_crypto_pci_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = virtio_crypto_pci_properties; + device_class_set_props(dc, virtio_crypto_pci_properties); pcidev_k->class_id = PCI_CLASS_OTHERS; } diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 6d42f95a89..7351ab0a19 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -955,7 +955,7 @@ static void virtio_crypto_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_crypto_properties; + device_class_set_props(dc, virtio_crypto_properties); dc->vmsd = &vmstate_virtio_crypto; set_bit(DEVICE_CATEGORY_MISC, dc->categories); vdc->realize = virtio_crypto_device_realize; diff --git a/hw/virtio/virtio-input-pci.c b/hw/virtio/virtio-input-pci.c index 80b1172c90..5a965408df 100644 --- a/hw/virtio/virtio-input-pci.c +++ b/hw/virtio/virtio-input-pci.c @@ -60,7 +60,7 @@ static void virtio_input_pci_class_init(ObjectClass *klass, void *data) VirtioPCIClass *k = VIRTIO_PCI_CLASS(klass); PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); - dc->props = virtio_input_pci_properties; + device_class_set_props(dc, virtio_input_pci_properties); k->realize = virtio_input_pci_realize; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 872f2cd237..f12d1595aa 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -712,7 +712,7 @@ static void virtio_mmio_class_init(ObjectClass *klass, void *data) dc->realize = virtio_mmio_realizefn; dc->reset = virtio_mmio_reset; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = virtio_mmio_properties; + device_class_set_props(dc, virtio_mmio_properties); } static const TypeInfo virtio_mmio_info = { diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index f670aed0a7..5ca71d4c34 100644 --- a/hw/virtio/virtio-net-pci.c +++ b/hw/virtio/virtio-net-pci.c @@ -68,7 +68,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass, void *data) k->revision = VIRTIO_PCI_ABI_VERSION; k->class_id = PCI_CLASS_NETWORK_ETHERNET; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); - dc->props = virtio_net_properties; + device_class_set_props(dc, virtio_net_properties); vpciklass->realize = virtio_net_pci_realize; } diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index f723b9f631..4cb784389c 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1886,7 +1886,7 @@ static void virtio_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass); - dc->props = virtio_pci_properties; + device_class_set_props(dc, virtio_pci_properties); k->realize = virtio_pci_realize; k->exit = virtio_pci_exit; k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; @@ -1925,7 +1925,7 @@ static void virtio_pci_generic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = virtio_pci_generic_properties; + device_class_set_props(dc, virtio_pci_generic_properties); } static void virtio_pci_transitional_instance_init(Object *obj) diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c index c0c9395e55..97287e923b 100644 --- a/hw/virtio/virtio-pmem.c +++ b/hw/virtio/virtio-pmem.c @@ -165,7 +165,7 @@ static void virtio_pmem_class_init(ObjectClass *klass, void *data) VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); VirtIOPMEMClass *vpc = VIRTIO_PMEM_CLASS(klass); - dc->props = virtio_pmem_properties; + device_class_set_props(dc, virtio_pmem_properties); vdc->realize = virtio_pmem_realize; vdc->unrealize = virtio_pmem_unrealize; diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index b498a20332..1e363ad07b 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -269,7 +269,7 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_rng_properties; + device_class_set_props(dc, virtio_rng_properties); dc->vmsd = &vmstate_virtio_rng; set_bit(DEVICE_CATEGORY_MISC, dc->categories); vdc->realize = virtio_rng_device_realize; diff --git a/hw/virtio/virtio-scsi-pci.c b/hw/virtio/virtio-scsi-pci.c index 3c55dc19a1..e82e7e5680 100644 --- a/hw/virtio/virtio-scsi-pci.c +++ b/hw/virtio/virtio-scsi-pci.c @@ -76,7 +76,7 @@ static void virtio_scsi_pci_class_init(ObjectClass *klass, void *data) k->realize = virtio_scsi_pci_realize; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = virtio_scsi_pci_properties; + device_class_set_props(dc, virtio_scsi_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_SCSI; pcidev_k->revision = 0x00; diff --git a/hw/virtio/virtio-serial-pci.c b/hw/virtio/virtio-serial-pci.c index 953abbd13a..22ab4d8562 100644 --- a/hw/virtio/virtio-serial-pci.c +++ b/hw/virtio/virtio-serial-pci.c @@ -84,7 +84,7 @@ static void virtio_serial_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = virtio_serial_pci_realize; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); - dc->props = virtio_serial_pci_properties; + device_class_set_props(dc, virtio_serial_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_CONSOLE; pcidev_k->revision = VIRTIO_PCI_ABI_VERSION; diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 7b861e0ca0..2c5410e981 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3713,7 +3713,7 @@ static void virtio_device_class_init(ObjectClass *klass, void *data) dc->realize = virtio_device_realize; dc->unrealize = virtio_device_unrealize; dc->bus_type = TYPE_VIRTIO_BUS; - dc->props = virtio_properties; + device_class_set_props(dc, virtio_properties); vdc->start_ioeventfd = virtio_device_start_ioeventfd_impl; vdc->stop_ioeventfd = virtio_device_stop_ioeventfd_impl; |