summaryrefslogtreecommitdiffstats
path: root/qom/object.c
diff options
context:
space:
mode:
authorPeter Maydell2020-07-09 18:02:29 +0200
committerPeter Maydell2020-07-09 18:02:29 +0200
commitaff2caf6b3fbab1062e117a47b66d27f7fd2f272 (patch)
tree75bf4ee375bd40ecb542ccacfe4328c88811b088 /qom/object.c
parentMerge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.1-pul... (diff)
parentchardev: enable modules, use for braille (diff)
downloadqemu-aff2caf6b3fbab1062e117a47b66d27f7fd2f272.tar.gz
qemu-aff2caf6b3fbab1062e117a47b66d27f7fd2f272.tar.xz
qemu-aff2caf6b3fbab1062e117a47b66d27f7fd2f272.zip
Merge remote-tracking branch 'remotes/kraxel/tags/modules-20200707-pull-request' into staging
qom: add support for qom objects in modules. build some devices (qxl, virtio-gpu, ccid, usb-redir) as modules. build braille chardev as module. v2: more verbose comment for "build: fix device module builds" patch. note: qemu doesn't rebuild objects on cflags changes (specifically -fPIC being added when code is switched from builtin to module). Workaround for resulting build errors: "make clean", rebuild. # gpg: Signature made Tue 07 Jul 2020 14:42:16 BST # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/modules-20200707-pull-request: chardev: enable modules, use for braille vga: build virtio-gpu as module vga: build virtio-gpu only once vga: build qxl as module usb: build usb-redir as module ccid: build smartcard as module build: fix device module builds qdev: device module support object: qom module support module: qom module support Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qom/object.c')
-rw-r--r--qom/object.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c
index 6ece96bc2b..34daaf1280 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -985,6 +985,20 @@ ObjectClass *object_class_by_name(const char *typename)
return type->class;
}
+ObjectClass *module_object_class_by_name(const char *typename)
+{
+ ObjectClass *oc;
+
+ oc = object_class_by_name(typename);
+#ifdef CONFIG_MODULES
+ if (!oc) {
+ module_load_qom_one(typename);
+ oc = object_class_by_name(typename);
+ }
+#endif
+ return oc;
+}
+
ObjectClass *object_class_get_parent(ObjectClass *class)
{
TypeImpl *type = type_get_parent(class->type);