modules: add module_obj() note to QOM docs

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Jose R. Ziviani <jziviani@suse.de>
Message-Id: <20210624103836.2382472-23-kraxel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Gerd Hoffmann 2021-06-24 12:38:24 +02:00 committed by Paolo Bonzini
parent 964711c44c
commit e95b135f88
1 changed files with 8 additions and 0 deletions

View File

@ -87,6 +87,14 @@ specific type:
#define MY_DEVICE(obj) \ #define MY_DEVICE(obj) \
OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE) 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 Class Initialization
==================== ====================