aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2023-07-10 16:35:04 +0100
committerMichael S. Tsirkin <mst@redhat.com>2023-07-10 18:59:32 -0400
commitc378e88218c9679d7df8230c9f988b22a6cbdc1a (patch)
tree8f9d8012afd4699a526773c2f4f0ea8a8db8769e /include
parente57fc3dec9508cfa81c1bedcaa6b7469995ac6a5 (diff)
downloadqemu-c378e88218c9679d7df8230c9f988b22a6cbdc1a.zip
qemu-c378e88218c9679d7df8230c9f988b22a6cbdc1a.tar.gz
qemu-c378e88218c9679d7df8230c9f988b22a6cbdc1a.tar.bz2
include/hw: document the device_class_set_parent_* fns
These are useful functions for when you want proper inheritance of functionality across realize/unrealize calls. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230710153522.3469097-3-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/qdev-core.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 196ebf6..884c726 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -952,9 +952,36 @@ void device_class_set_props(DeviceClass *dc, Property *props);
void device_class_set_parent_reset(DeviceClass *dc,
DeviceReset dev_reset,
DeviceReset *parent_reset);
+
+/**
+ * device_class_set_parent_realize() - set up for chaining realize fns
+ * @dc: The device class
+ * @dev_realize: the device realize function
+ * @parent_realize: somewhere to save the parents realize function
+ *
+ * This is intended to be used when the new realize function will
+ * eventually call its parent realization function during creation.
+ * This requires storing the function call somewhere (usually in the
+ * instance structure) so you can eventually call
+ * dc->parent_realize(dev, errp)
+ */
void device_class_set_parent_realize(DeviceClass *dc,
DeviceRealize dev_realize,
DeviceRealize *parent_realize);
+
+
+/**
+ * device_class_set_parent_unrealize() - set up for chaining unrealize fns
+ * @dc: The device class
+ * @dev_unrealize: the device realize function
+ * @parent_unrealize: somewhere to save the parents unrealize function
+ *
+ * This is intended to be used when the new unrealize function will
+ * eventually call its parent unrealization function during the
+ * unrealize phase. This requires storing the function call somewhere
+ * (usually in the instance structure) so you can eventually call
+ * dc->parent_unrealize(dev);
+ */
void device_class_set_parent_unrealize(DeviceClass *dc,
DeviceUnrealize dev_unrealize,
DeviceUnrealize *parent_unrealize);