mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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>
This commit is contained in:
parent
b77ade9bb3
commit
4f67d30b5e
399 changed files with 458 additions and 451 deletions
|
@ -2624,7 +2624,7 @@ static void pci_device_class_init(ObjectClass *klass, void *data)
|
|||
k->realize = pci_qdev_realize;
|
||||
k->unrealize = pci_qdev_unrealize;
|
||||
k->bus_type = TYPE_PCI_BUS;
|
||||
k->props = pci_props;
|
||||
device_class_set_props(k, pci_props);
|
||||
}
|
||||
|
||||
static void pci_device_class_base_init(ObjectClass *klass, void *data)
|
||||
|
|
|
@ -133,7 +133,7 @@ static void pcie_port_class_init(ObjectClass *oc, void *data)
|
|||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
|
||||
dc->props = pcie_port_props;
|
||||
device_class_set_props(dc, pcie_port_props);
|
||||
}
|
||||
|
||||
static const TypeInfo pcie_port_type_info = {
|
||||
|
@ -155,7 +155,7 @@ static void pcie_slot_class_init(ObjectClass *oc, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
|
||||
|
||||
dc->props = pcie_slot_props;
|
||||
device_class_set_props(dc, pcie_slot_props);
|
||||
hc->pre_plug = pcie_cap_slot_pre_plug_cb;
|
||||
hc->plug = pcie_cap_slot_plug_cb;
|
||||
hc->unplug = pcie_cap_slot_unplug_cb;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue