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/pci-host | |
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/pci-host')
-rw-r--r-- | hw/pci-host/grackle.c | 2 | ||||
-rw-r--r-- | hw/pci-host/i440fx.c | 2 | ||||
-rw-r--r-- | hw/pci-host/ppce500.c | 2 | ||||
-rw-r--r-- | hw/pci-host/prep.c | 2 | ||||
-rw-r--r-- | hw/pci-host/q35.c | 4 | ||||
-rw-r--r-- | hw/pci-host/sabre.c | 2 | ||||
-rw-r--r-- | hw/pci-host/uninorth.c | 2 | ||||
-rw-r--r-- | hw/pci-host/versatile.c | 2 | ||||
-rw-r--r-- | hw/pci-host/xilinx-pcie.c | 2 |
9 files changed, 10 insertions, 10 deletions
diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 537273e..24ccdf6 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -168,7 +168,7 @@ static void grackle_class_init(ObjectClass *klass, void *data) SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); dc->realize = grackle_realize; - dc->props = grackle_properties; + device_class_set_props(dc, grackle_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; sbc->explicit_ofw_unit_address = grackle_ofw_unit_address; diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index bae7b42..11050a0 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -396,7 +396,7 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) hc->root_bus_path = i440fx_pcihost_root_bus_path; dc->realize = i440fx_pcihost_realize; dc->fw_name = "pci"; - dc->props = i440fx_props; + device_class_set_props(dc, i440fx_props); /* Reason: needs to be wired up by pc_init1 */ dc->user_creatable = false; } diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 8bed8e8..d710727 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -531,7 +531,7 @@ static void e500_pcihost_class_init(ObjectClass *klass, void *data) dc->realize = e500_pcihost_realize; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); - dc->props = pcihost_properties; + device_class_set_props(dc, pcihost_properties); dc->vmsd = &vmstate_ppce500_pci; } diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index afa136d..f2f8821 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -415,7 +415,7 @@ static void raven_pcihost_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->realize = raven_pcihost_realizefn; - dc->props = raven_pcihost_properties; + device_class_set_props(dc, raven_pcihost_properties); dc->fw_name = "pci"; } diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 158d270..0d5dbba 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -202,7 +202,7 @@ static void q35_host_class_init(ObjectClass *klass, void *data) hc->root_bus_path = q35_host_root_bus_path; dc->realize = q35_host_realize; - dc->props = q35_host_props; + device_class_set_props(dc, q35_host_props); /* Reason: needs to be wired up by pc_q35_init */ dc->user_creatable = false; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); @@ -612,7 +612,7 @@ static void mch_class_init(ObjectClass *klass, void *data) k->realize = mch_realize; k->config_write = mch_write_config; dc->reset = mch_reset; - dc->props = mch_props; + device_class_set_props(dc, mch_props); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->desc = "Host bridge"; dc->vmsd = &vmstate_mch; diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c index fae20ee..2b8503b 100644 --- a/hw/pci-host/sabre.c +++ b/hw/pci-host/sabre.c @@ -521,7 +521,7 @@ static void sabre_class_init(ObjectClass *klass, void *data) dc->realize = sabre_realize; dc->reset = sabre_reset; - dc->props = sabre_properties; + device_class_set_props(dc, sabre_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; sbc->explicit_ofw_unit_address = sabre_ofw_unit_address; diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index 75bc506..cf70b76 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -476,7 +476,7 @@ static void pci_unin_main_class_init(ObjectClass *klass, void *data) SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); dc->realize = pci_unin_main_realize; - dc->props = pci_unin_main_pci_host_props; + device_class_set_props(dc, pci_unin_main_pci_host_props); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; sbc->explicit_ofw_unit_address = pci_unin_main_ofw_unit_address; diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index b731d05..cfb9a78 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -509,7 +509,7 @@ static void pci_vpb_class_init(ObjectClass *klass, void *data) dc->realize = pci_vpb_realize; dc->reset = pci_vpb_reset; dc->vmsd = &pci_vpb_vmstate; - dc->props = pci_vpb_properties; + device_class_set_props(dc, pci_vpb_properties); } static const TypeInfo pci_vpb_info = { diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c index 17d5024..e06f2b5 100644 --- a/hw/pci-host/xilinx-pcie.c +++ b/hw/pci-host/xilinx-pcie.c @@ -177,7 +177,7 @@ static void xilinx_pcie_host_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_pcie_host_realize; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; - dc->props = xilinx_pcie_host_props; + device_class_set_props(dc, xilinx_pcie_host_props); } static const TypeInfo xilinx_pcie_host_info = { |