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/net | |
parent | b77ade9bb37b2e9813a42008cb21d0c743aa50a1 (diff) | |
download | qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.zip |
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/net')
-rw-r--r-- | hw/net/allwinner_emac.c | 2 | ||||
-rw-r--r-- | hw/net/cadence_gem.c | 2 | ||||
-rw-r--r-- | hw/net/dp8393x.c | 2 | ||||
-rw-r--r-- | hw/net/e1000.c | 2 | ||||
-rw-r--r-- | hw/net/e1000e.c | 2 | ||||
-rw-r--r-- | hw/net/eepro100.c | 2 | ||||
-rw-r--r-- | hw/net/etraxfs_eth.c | 2 | ||||
-rw-r--r-- | hw/net/fsl_etsec/etsec.c | 2 | ||||
-rw-r--r-- | hw/net/ftgmac100.c | 4 | ||||
-rw-r--r-- | hw/net/imx_fec.c | 2 | ||||
-rw-r--r-- | hw/net/lan9118.c | 2 | ||||
-rw-r--r-- | hw/net/lance.c | 2 | ||||
-rw-r--r-- | hw/net/mcf_fec.c | 2 | ||||
-rw-r--r-- | hw/net/milkymist-minimac2.c | 2 | ||||
-rw-r--r-- | hw/net/mipsnet.c | 2 | ||||
-rw-r--r-- | hw/net/ne2000-isa.c | 2 | ||||
-rw-r--r-- | hw/net/ne2000-pci.c | 2 | ||||
-rw-r--r-- | hw/net/opencores_eth.c | 2 | ||||
-rw-r--r-- | hw/net/pcnet-pci.c | 2 | ||||
-rw-r--r-- | hw/net/rocker/rocker.c | 2 | ||||
-rw-r--r-- | hw/net/rtl8139.c | 2 | ||||
-rw-r--r-- | hw/net/smc91c111.c | 2 | ||||
-rw-r--r-- | hw/net/spapr_llan.c | 2 | ||||
-rw-r--r-- | hw/net/stellaris_enet.c | 2 | ||||
-rw-r--r-- | hw/net/sungem.c | 2 | ||||
-rw-r--r-- | hw/net/sunhme.c | 2 | ||||
-rw-r--r-- | hw/net/tulip.c | 2 | ||||
-rw-r--r-- | hw/net/virtio-net.c | 2 | ||||
-rw-r--r-- | hw/net/vmxnet3.c | 2 | ||||
-rw-r--r-- | hw/net/xgmac.c | 2 | ||||
-rw-r--r-- | hw/net/xilinx_axienet.c | 2 | ||||
-rw-r--r-- | hw/net/xilinx_ethlite.c | 2 |
32 files changed, 33 insertions, 33 deletions
diff --git a/hw/net/allwinner_emac.c b/hw/net/allwinner_emac.c index e055a661c4..e9bbff8710 100644 --- a/hw/net/allwinner_emac.c +++ b/hw/net/allwinner_emac.c @@ -519,7 +519,7 @@ static void aw_emac_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = aw_emac_realize; - dc->props = aw_emac_properties; + device_class_set_props(dc, aw_emac_properties); dc->reset = aw_emac_reset; dc->vmsd = &vmstate_aw_emac; } diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index b8be73dc55..871fcf2031 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1627,7 +1627,7 @@ static void gem_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = gem_realize; - dc->props = gem_properties; + device_class_set_props(dc, gem_properties); dc->vmsd = &vmstate_cadence_gem; dc->reset = gem_reset; } diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index cdc2631c0c..a134d431ae 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -963,7 +963,7 @@ static void dp8393x_class_init(ObjectClass *klass, void *data) dc->realize = dp8393x_realize; dc->reset = dp8393x_reset; dc->vmsd = &vmstate_dp8393x; - dc->props = dp8393x_properties; + device_class_set_props(dc, dp8393x_properties); } static const TypeInfo dp8393x_info = { diff --git a/hw/net/e1000.c b/hw/net/e1000.c index a73f8d404e..0b833d5a15 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1764,7 +1764,7 @@ static void e1000_class_init(ObjectClass *klass, void *data) dc->desc = "Intel Gigabit Ethernet"; dc->reset = qdev_e1000_reset; dc->vmsd = &vmstate_e1000; - dc->props = e1000_properties; + device_class_set_props(dc, e1000_properties); } static void e1000_instance_init(Object *obj) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index b69fd7d8ad..a91dbdca3c 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -684,7 +684,6 @@ static void e1000e_class_init(ObjectClass *class, void *data) dc->desc = "Intel 82574L GbE Controller"; dc->reset = e1000e_qdev_reset; dc->vmsd = &e1000e_vmstate; - dc->props = e1000e_properties; e1000e_prop_disable_vnet = qdev_prop_uint8; e1000e_prop_disable_vnet.description = "Do not use virtio headers, " @@ -697,6 +696,7 @@ static void e1000e_class_init(ObjectClass *class, void *data) e1000e_prop_subsys = qdev_prop_uint16; e1000e_prop_subsys.description = "PCI device Subsystem ID"; + device_class_set_props(dc, e1000e_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 6cc97769d9..f6474f0e68 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -2060,7 +2060,7 @@ static void eepro100_class_init(ObjectClass *klass, void *data) info = eepro100_get_class_by_name(object_class_get_name(klass)); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); - dc->props = e100_properties; + device_class_set_props(dc, e100_properties); dc->desc = info->desc; k->vendor_id = PCI_VENDOR_ID_INTEL; k->class_id = PCI_CLASS_NETWORK_ETHERNET; diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c index f30d963487..27fd069b96 100644 --- a/hw/net/etraxfs_eth.c +++ b/hw/net/etraxfs_eth.c @@ -639,7 +639,7 @@ static void etraxfs_eth_class_init(ObjectClass *klass, void *data) dc->realize = etraxfs_eth_realize; dc->reset = etraxfs_eth_reset; - dc->props = etraxfs_eth_properties; + device_class_set_props(dc, etraxfs_eth_properties); /* Reason: dma_out, dma_in are not user settable */ dc->user_creatable = false; } diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index 717de76569..475f3c887a 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -423,7 +423,7 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->realize = etsec_realize; dc->reset = etsec_reset; - dc->props = etsec_properties; + device_class_set_props(dc, etsec_properties); /* Supported by ppce500 machine */ dc->user_creatable = true; } diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 86ac25894a..4ad2594d3a 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -1075,7 +1075,7 @@ static void ftgmac100_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_ftgmac100; dc->reset = ftgmac100_reset; - dc->props = ftgmac100_properties; + device_class_set_props(dc, ftgmac100_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->realize = ftgmac100_realize; dc->desc = "Faraday FTGMAC100 Gigabit Ethernet emulation"; @@ -1237,7 +1237,7 @@ static void aspeed_mii_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_mii_reset; dc->realize = aspeed_mii_realize; dc->desc = "Aspeed MII controller"; - dc->props = aspeed_mii_properties; + device_class_set_props(dc, aspeed_mii_properties); } static const TypeInfo aspeed_mii_info = { diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 5a83678f64..6a124a154a 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -1338,7 +1338,7 @@ static void imx_eth_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_imx_eth; dc->reset = imx_eth_reset; - dc->props = imx_eth_properties; + device_class_set_props(dc, imx_eth_properties); dc->realize = imx_eth_realize; dc->desc = "i.MX FEC/ENET Ethernet Controller"; } diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index ed551f2178..da7e0bb0e8 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -1369,7 +1369,7 @@ static void lan9118_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = lan9118_reset; - dc->props = lan9118_properties; + device_class_set_props(dc, lan9118_properties); dc->vmsd = &vmstate_lan9118; dc->realize = lan9118_realize; } diff --git a/hw/net/lance.c b/hw/net/lance.c index 4d96299041..688724db0b 100644 --- a/hw/net/lance.c +++ b/hw/net/lance.c @@ -153,7 +153,7 @@ static void lance_class_init(ObjectClass *klass, void *data) dc->fw_name = "ethernet"; dc->reset = lance_reset; dc->vmsd = &vmstate_lance; - dc->props = lance_properties; + device_class_set_props(dc, lance_properties); } static const TypeInfo lance_info = { diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c index 8fcf354a4b..9327ac8a30 100644 --- a/hw/net/mcf_fec.c +++ b/hw/net/mcf_fec.c @@ -670,7 +670,7 @@ static void mcf_fec_class_init(ObjectClass *oc, void *data) dc->realize = mcf_fec_realize; dc->desc = "MCF Fast Ethernet Controller network device"; dc->reset = mcf_fec_reset; - dc->props = mcf_fec_properties; + device_class_set_props(dc, mcf_fec_properties); } static const TypeInfo mcf_fec_info = { diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c index 86b6d28033..1ba01754ee 100644 --- a/hw/net/milkymist-minimac2.c +++ b/hw/net/milkymist-minimac2.c @@ -530,7 +530,7 @@ static void milkymist_minimac2_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_minimac2_realize; dc->reset = milkymist_minimac2_reset; dc->vmsd = &vmstate_milkymist_minimac2; - dc->props = milkymist_minimac2_properties; + device_class_set_props(dc, milkymist_minimac2_properties); } static const TypeInfo milkymist_minimac2_info = { diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c index 380ff5a5f4..0c578c430c 100644 --- a/hw/net/mipsnet.c +++ b/hw/net/mipsnet.c @@ -278,7 +278,7 @@ static void mipsnet_class_init(ObjectClass *klass, void *data) dc->desc = "MIPS Simulator network device"; dc->reset = mipsnet_sysbus_reset; dc->vmsd = &vmstate_mipsnet; - dc->props = mipsnet_properties; + device_class_set_props(dc, mipsnet_properties); } static const TypeInfo mipsnet_info = { diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 6fcf3d5cd9..e744eff153 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -89,7 +89,7 @@ static void isa_ne2000_class_initfn(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = isa_ne2000_realizefn; - dc->props = ne2000_isa_properties; + device_class_set_props(dc, ne2000_isa_properties); dc->vmsd = &vmstate_isa_ne2000; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c index 9a20d427e3..e11d67bf75 100644 --- a/hw/net/ne2000-pci.c +++ b/hw/net/ne2000-pci.c @@ -112,7 +112,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data) k->device_id = PCI_DEVICE_ID_REALTEK_8029; k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->vmsd = &vmstate_pci_ne2000; - dc->props = ne2000_properties; + device_class_set_props(dc, ne2000_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c index 84a95da1d5..6b338c2f29 100644 --- a/hw/net/opencores_eth.c +++ b/hw/net/opencores_eth.c @@ -755,7 +755,7 @@ static void open_eth_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->desc = "Opencores 10/100 Mbit Ethernet"; dc->reset = qdev_open_eth_reset; - dc->props = open_eth_properties; + device_class_set_props(dc, open_eth_properties); } static const TypeInfo open_eth_info = { diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index d067d21e2c..d1f31e0272 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -272,7 +272,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->reset = pci_reset; dc->vmsd = &vmstate_pci_pcnet; - dc->props = pcnet_properties; + device_class_set_props(dc, pcnet_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 50f9e33e2f..81dd3b5f14 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1519,7 +1519,7 @@ static void rocker_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->desc = "Rocker Switch"; dc->reset = rocker_reset; - dc->props = rocker_properties; + device_class_set_props(dc, rocker_properties); dc->vmsd = &rocker_vmsd; } diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 88a97d756d..ae4739bc09 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -3435,7 +3435,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->reset = rtl8139_reset; dc->vmsd = &vmstate_rtl8139; - dc->props = rtl8139_properties; + device_class_set_props(dc, rtl8139_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index e574635969..e9eb6f6c05 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -798,7 +798,7 @@ static void smc91c111_class_init(ObjectClass *klass, void *data) dc->realize = smc91c111_realize; dc->reset = smc91c111_reset; dc->vmsd = &vmstate_smc91c111; - dc->props = smc91c111_properties; + device_class_set_props(dc, smc91c111_properties); } static const TypeInfo smc91c111_info = { diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index 3d96884d66..80f5a1dd37 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -856,7 +856,7 @@ static void spapr_vlan_class_init(ObjectClass *klass, void *data) k->dt_compatible = "IBM,l-lan"; k->signal_mask = 0x1; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); - dc->props = spapr_vlan_properties; + device_class_set_props(dc, spapr_vlan_properties); k->rtce_window_size = 0x10000000; dc->vmsd = &vmstate_spapr_llan; } diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c index 3aca2a09f3..cb6e2509ea 100644 --- a/hw/net/stellaris_enet.c +++ b/hw/net/stellaris_enet.c @@ -507,7 +507,7 @@ static void stellaris_enet_class_init(ObjectClass *klass, void *data) dc->realize = stellaris_enet_realize; dc->reset = stellaris_enet_reset; - dc->props = stellaris_enet_properties; + device_class_set_props(dc, stellaris_enet_properties); dc->vmsd = &vmstate_stellaris_enet; } diff --git a/hw/net/sungem.c b/hw/net/sungem.c index f31d41ac5b..89da51f7f6 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -1429,7 +1429,7 @@ static void sungem_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->vmsd = &vmstate_sungem; dc->reset = sungem_reset; - dc->props = sungem_properties; + device_class_set_props(dc, sungem_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index 2243b7cf7b..8863601f6c 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -958,7 +958,7 @@ static void sunhme_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->vmsd = &vmstate_hme; dc->reset = sunhme_reset; - dc->props = sunhme_properties; + device_class_set_props(dc, sunhme_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/tulip.c b/hw/net/tulip.c index f85f54341f..cfac2719d3 100644 --- a/hw/net/tulip.c +++ b/hw/net/tulip.c @@ -1004,7 +1004,7 @@ static void tulip_class_init(ObjectClass *klass, void *data) k->subsystem_id = 0x104f; k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->vmsd = &vmstate_pci_tulip; - dc->props = tulip_properties; + device_class_set_props(dc, tulip_properties); dc->reset = tulip_qdev_reset; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index d7d3ad6dc7..3627bb1717 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3236,7 +3236,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_net_properties; + device_class_set_props(dc, virtio_net_properties); dc->vmsd = &vmstate_virtio_net; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); vdc->realize = virtio_net_device_realize; diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 39ff6624c5..6d91cd8309 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -2506,7 +2506,7 @@ static void vmxnet3_class_init(ObjectClass *class, void *data) dc->desc = "VMWare Paravirtualized Ethernet v3"; dc->reset = vmxnet3_qdev_reset; dc->vmsd = &vmstate_vmxnet3; - dc->props = vmxnet3_properties; + device_class_set_props(dc, vmxnet3_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c index 2ea8d2ec72..574dd47b41 100644 --- a/hw/net/xgmac.c +++ b/hw/net/xgmac.c @@ -414,7 +414,7 @@ static void xgmac_enet_class_init(ObjectClass *klass, void *data) dc->realize = xgmac_enet_realize; dc->vmsd = &vmstate_xgmac; - dc->props = xgmac_properties; + device_class_set_props(dc, xgmac_properties); } static const TypeInfo xgmac_enet_info = { diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 2c8c065401..704788811a 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -1025,7 +1025,7 @@ static void xilinx_enet_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = xilinx_enet_realize; - dc->props = xilinx_enet_properties; + device_class_set_props(dc, xilinx_enet_properties); dc->reset = xilinx_axienet_reset; } diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 384e72b157..cf07e698b3 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -262,7 +262,7 @@ static void xilinx_ethlite_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_ethlite_realize; dc->reset = xilinx_ethlite_reset; - dc->props = xilinx_ethlite_properties; + device_class_set_props(dc, xilinx_ethlite_properties); } static const TypeInfo xilinx_ethlite_info = { |