diff mbox series

[2/4] modules: add module_obj() note to QOM docs

Message ID 20210622125110.262843-3-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series modules: update developer documentation | expand

Commit Message

Gerd Hoffmann June 22, 2021, 12:51 p.m. UTC
---
 docs/devel/qom.rst | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
index 42d0dc4f4da8..e5fe3597cd82 100644
--- a/docs/devel/qom.rst
+++ b/docs/devel/qom.rst
@@ -87,6 +87,14 @@  specific type:
    #define MY_DEVICE(obj) \
       OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)
 
+In case the ObjectClass implementation can be built as module a
+module_obj() line must be added to make sure qemu loads the module
+when the object is needed.
+
+.. code-block:: c
+
+   module_obj(TYPE_MY_DEVICE);
+
 Class Initialization
 ====================