[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/24] modules: add modinfo macros
From: |
Gerd Hoffmann |
Subject: |
[PATCH v3 01/24] modules: add modinfo macros |
Date: |
Fri, 18 Jun 2021 06:53:30 +0200 |
Add macros for module info annotations.
Instead of having that module meta-data stored in lists in util/module.c
place directly in the module source code.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/qemu/module.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/include/qemu/module.h b/include/qemu/module.h
index 944d403cbd15..81ef086da023 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -73,4 +73,29 @@ bool module_load_one(const char *prefix, const char
*lib_name, bool mayfail);
void module_load_qom_one(const char *type);
void module_load_qom_all(void);
+/*
+ * module info annotation macros
+ *
+ * scripts/modinfo-collect.py will collect module info,
+ * using the preprocessor and -DQEMU_MODINFO
+ */
+#ifdef QEMU_MODINFO
+# define modinfo(kind, value) \
+ MODINFO_START kind value MODINFO_END
+#else
+# define modinfo(kind, value)
+#endif
+
+/* module implements QOM type <name> */
+#define module_obj(name) modinfo(obj, name)
+
+/* module has a dependency on <name> */
+#define module_dep(name) modinfo(dep, name)
+
+/* module is for target architecture <name> */
+#define module_arch(name) modinfo(arch, name)
+
+/* module registers QemuOpts <name> */
+#define module_opts(name) modinfo(opts, name)
+
#endif
--
2.31.1
- [PATCH v3 00/24] modules: add meta-data database, Gerd Hoffmann, 2021/06/18
- [PATCH v3 02/24] modules: collect module meta-data, Gerd Hoffmann, 2021/06/18
- [PATCH v3 01/24] modules: add modinfo macros,
Gerd Hoffmann <=
- [PATCH v3 04/24] modules: add qxl module annotations, Gerd Hoffmann, 2021/06/18
- [PATCH v3 03/24] modules: generate modinfo.c, Gerd Hoffmann, 2021/06/18
- [PATCH v3 05/24] modules: add virtio-gpu module annotations, Gerd Hoffmann, 2021/06/18
- [PATCH v3 06/24] modules: add chardev module annotations, Gerd Hoffmann, 2021/06/18
- [PATCH v3 07/24] modules: add audio module annotations, Gerd Hoffmann, 2021/06/18
- [PATCH v3 08/24] modules: add usb-redir module annotations, Gerd Hoffmann, 2021/06/18
- [PATCH v3 09/24] modules: add ccid module annotations, Gerd Hoffmann, 2021/06/18