qdev: Convert to qdev_unrealize() with Coccinelle
For readability, and consistency with qbus_realize(). Coccinelle script: @ depends on !(file in "hw/core/qdev.c")@ typedef DeviceState; DeviceState *dev; symbol false, error_abort; @@ - object_property_set_bool(OBJECT(dev), false, "realized", &error_abort); + qdev_unrealize(dev); @ depends on !(file in "hw/core/qdev.c") && !(file in "hw/core/bus.c")@ expression dev; symbol false, error_abort; @@ - object_property_set_bool(OBJECT(dev), false, "realized", &error_abort); + qdev_unrealize(DEVICE(dev)); Signed-off-by:Markus Armbruster <armbru@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200610053247.1583243-8-armbru@redhat.com>
Showing
- hw/acpi/pcihp.c 1 addition, 1 deletionhw/acpi/pcihp.c
- hw/char/serial-pci-multi.c 1 addition, 1 deletionhw/char/serial-pci-multi.c
- hw/char/serial-pci.c 1 addition, 1 deletionhw/char/serial-pci.c
- hw/core/bus.c 1 addition, 2 deletionshw/core/bus.c
- hw/i386/pc.c 2 additions, 2 deletionshw/i386/pc.c
- hw/pci/pcie.c 1 addition, 1 deletionhw/pci/pcie.c
- hw/pci/shpc.c 1 addition, 1 deletionhw/pci/shpc.c
- hw/ppc/spapr.c 4 additions, 4 deletionshw/ppc/spapr.c
- hw/ppc/spapr_pci.c 1 addition, 2 deletionshw/ppc/spapr_pci.c
- hw/s390x/css-bridge.c 1 addition, 1 deletionhw/s390x/css-bridge.c
- hw/s390x/s390-pci-bus.c 2 additions, 2 deletionshw/s390x/s390-pci-bus.c
Loading
Please register or sign in to comment