[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/12] qdev: Document qdev_unrealize()
From: |
Peter Maydell |
Subject: |
[PULL 06/12] qdev: Document qdev_unrealize() |
Date: |
Mon, 20 Jul 2020 13:56:15 +0100 |
Add a doc comment for qdev_unrealize(), to go with the new
documentation for the realize part of the qdev lifecycle.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200711142425.16283-3-peter.maydell@linaro.org
---
include/hw/qdev-core.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 2d441d1fb2e..1d2bf5f37da 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -381,6 +381,25 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Error
**errp);
* would be incorrect. For that use case you want qdev_realize().
*/
bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp);
+/**
+ * qdev_unrealize: Unrealize a device
+ * @dev: device to unrealize
+ *
+ * This function will "unrealize" a device, which is the first phase
+ * of correctly destroying a device that has been realized. It will:
+ *
+ * - unrealize any child buses by calling qbus_unrealize()
+ * (this will recursively unrealize any devices on those buses)
+ * - call the the unrealize method of @dev
+ *
+ * The device can then be freed by causing its reference count to go
+ * to zero.
+ *
+ * Warning: most devices in QEMU do not expect to be unrealized. Only
+ * devices which are hot-unpluggable should be unrealized (as part of
+ * the unplugging process); all other devices are expected to last for
+ * the life of the simulation and should not be unrealized and freed.
+ */
void qdev_unrealize(DeviceState *dev);
void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
int required_for_version);
--
2.20.1
- [PULL 00/12] target-arm queue, Peter Maydell, 2020/07/20
- [PULL 01/12] hw/arm/virt: Enable MTE via a machine property, Peter Maydell, 2020/07/20
- [PULL 02/12] hw/arm/virt: Error for MTE enabled with KVM, Peter Maydell, 2020/07/20
- [PULL 04/12] util: Implement qemu_get_thread_id() for OpenBSD, Peter Maydell, 2020/07/20
- [PULL 03/12] hw/arm/virt: Disable memory hotplug when MTE is enabled, Peter Maydell, 2020/07/20
- [PULL 05/12] qdev: Move doc comments from qdev.c to qdev-core.h, Peter Maydell, 2020/07/20
- [PULL 06/12] qdev: Document qdev_unrealize(),
Peter Maydell <=
- [PULL 07/12] qdev: Document GPIO related functions, Peter Maydell, 2020/07/20
- [PULL 08/12] hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize(), Peter Maydell, 2020/07/20
- [PULL 09/12] docs/system: Briefly document canon-a1100 board, Peter Maydell, 2020/07/20
- [PULL 11/12] docs/system: Briefly document gumstix boards, Peter Maydell, 2020/07/20
- [PULL 10/12] docs/system: Briefly document collie board, Peter Maydell, 2020/07/20
- [PULL 12/12] docs/system: Document the arm virt board, Peter Maydell, 2020/07/20
- Re: [PULL 00/12] target-arm queue, Peter Maydell, 2020/07/20