diff options
author | Markus Armbruster | 2020-06-10 07:31:56 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-06-15 21:36:30 +0200 |
commit | 981c3dcd948907f1127bc1d85b6e455dce687096 (patch) | |
tree | ba8b8731ecb8be71cf5b1402f8a7c7b251ffbcce /hw/acpi/pcihp.c | |
parent | qdev: Convert to qbus_realize(), qbus_unrealize() (diff) | |
download | qemu-981c3dcd948907f1127bc1d85b6e455dce687096.tar.gz qemu-981c3dcd948907f1127bc1d85b6e455dce687096.tar.xz qemu-981c3dcd948907f1127bc1d85b6e455dce687096.zip |
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>
Diffstat (limited to 'hw/acpi/pcihp.c')
-rw-r--r-- | hw/acpi/pcihp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index d42906ea19..33ea2b76ae 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -266,7 +266,7 @@ void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s, { trace_acpi_pci_unplug(PCI_SLOT(PCI_DEVICE(dev)->devfn), acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev)))); - object_property_set_bool(OBJECT(dev), false, "realized", &error_abort); + qdev_unrealize(dev); } void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev, |