From: Gerd Hoffmann Date: Thu, 24 Jun 2021 10:38:24 +0000 (+0200) Subject: modules: add module_obj() note to QOM docs X-Git-Tag: v6.1.0-rc0~28^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e95b135f88f6e3a29387cd4aabb410b8f966fc81;p=thirdparty%2Fqemu.git modules: add module_obj() note to QOM docs Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini Reviewed-by: Jose R. Ziviani Message-Id: <20210624103836.2382472-23-kraxel@redhat.com> Signed-off-by: Paolo Bonzini --- diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index 42d0dc4f4da..e5fe3597cd8 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 ====================