* [PATCH 1/9] Add module metadata macros, add qxl module annotations
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 2/9] add qemu-modinfo utility Gerd Hoffmann
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
Stealing an idea from the linux kernel: Place module metadata
in an .modinfo elf section. This patch adds macros and qxl module
annotations as example.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/qemu/module.h | 18 ++++++++++++++++++
hw/display/qxl.c | 4 ++++
2 files changed, 22 insertions(+)
diff --git a/include/qemu/module.h b/include/qemu/module.h
index 944d403cbd15..afb9656ba4e7 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -73,4 +73,22 @@ 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);
+/*
+ * objdump -t -s -j .modinfo ${module}.so
+ */
+
+#define ___PASTE(a, b) a##b
+#define __PASTE(a, b) ___PASTE(a, b)
+
+#define modinfo(kind, value) \
+ static const char __PASTE(kind, __LINE__)[] \
+ __attribute__((__used__)) \
+ __attribute__((section(".modinfo"))) \
+ __attribute__((aligned(1))) \
+ = stringify(kind) "=" value
+
+#define module_obj(name) modinfo(obj, name)
+#define module_dep(name) modinfo(dep, name)
+#define module_arch(name) modinfo(arch, name)
+
#endif
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 6e1f8ff1b2a7..84f99088e0a0 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2522,6 +2522,7 @@ static const TypeInfo qxl_primary_info = {
.parent = TYPE_PCI_QXL,
.class_init = qxl_primary_class_init,
};
+module_obj("qxl-vga");
static void qxl_secondary_class_init(ObjectClass *klass, void *data)
{
@@ -2538,6 +2539,7 @@ static const TypeInfo qxl_secondary_info = {
.parent = TYPE_PCI_QXL,
.class_init = qxl_secondary_class_init,
};
+module_obj("qxl");
static void qxl_register_types(void)
{
@@ -2547,3 +2549,5 @@ static void qxl_register_types(void)
}
type_init(qxl_register_types)
+
+module_dep("ui-spice-core");
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/9] add qemu-modinfo utility
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 1/9] Add module metadata macros, add qxl module annotations Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 3/9] virtio-gpu module annotations Gerd Hoffmann
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
For now only dump metadata.
TODO:
* store in some file format (json?).
* make qemu parse it, replace hard-coded lists in util/module.c
* fix windows (seems to not have glob).
* do we need non-elf support?
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
qemu-modinfo.c | 182 +++++++++++++++++++++++++++++++++++++++++++++++++
meson.build | 3 +
2 files changed, 185 insertions(+)
create mode 100644 qemu-modinfo.c
diff --git a/qemu-modinfo.c b/qemu-modinfo.c
new file mode 100644
index 000000000000..ecd5f6c3adf2
--- /dev/null
+++ b/qemu-modinfo.c
@@ -0,0 +1,182 @@
+/*
+ * QEMU module parser
+ *
+ * read modules, find modinfo section, parse & store metadata.
+ *
+ * Copyright Red Hat, Inc. 2021
+ *
+ * Authors:
+ * Gerd Hoffmann <kraxel@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "qemu/osdep.h"
+#include "elf.h"
+#include <glob.h>
+
+#define Elf_Ehdr Elf64_Ehdr
+#define Elf_Shdr Elf64_Shdr
+#define ELFCLASS ELFCLASS64
+
+static const char *moddir = CONFIG_QEMU_MODDIR;
+static const char *dsosuf = CONFIG_HOST_DSOSUF;
+
+static void modinfo(const char *module, char *info, size_t size)
+{
+ size_t pos = 0, len;
+
+ fprintf(stderr, "%s\n", module);
+ do {
+ fprintf(stderr, " -> %s\n", info + pos);
+ len = strlen(info + pos) + 1;
+ pos += len;
+ } while (pos < size);
+}
+
+static void elf_read_section_hdr(FILE *fp, Elf_Ehdr *ehdr,
+ int section, Elf_Shdr *shdr)
+{
+ size_t pos, len;
+ int ret;
+
+ pos = ehdr->e_shoff + section * ehdr->e_shentsize;
+ len = MIN(ehdr->e_shentsize, sizeof(*shdr));
+
+ ret = fseek(fp, pos, SEEK_SET);
+ if (ret != 0) {
+ fprintf(stderr, "seek error\n");
+ exit(1);
+ }
+
+ memset(shdr, 0, sizeof(*shdr));
+ ret = fread(shdr, len, 1, fp);
+ if (ret != 1) {
+ fprintf(stderr, "read error\n");
+ exit(1);
+ }
+}
+
+static void *elf_read_section(FILE *fp, Elf_Ehdr *ehdr,
+ int section, size_t *size)
+{
+ Elf_Shdr shdr;
+ void *data;
+ int ret;
+
+ elf_read_section_hdr(fp, ehdr, section, &shdr);
+ if (shdr.sh_offset && shdr.sh_size) {
+ ret = fseek(fp, shdr.sh_offset, SEEK_SET);
+ if (ret != 0) {
+ fprintf(stderr, "seek error\n");
+ exit(1);
+ }
+
+ data = g_malloc(shdr.sh_size);
+ ret = fread(data, shdr.sh_size, 1, fp);
+ if (ret != 1) {
+ fprintf(stderr, "read error\n");
+ exit(1);
+ }
+ *size = shdr.sh_size;
+ } else {
+ data = NULL;
+ *size = 0;
+ }
+ return data;
+}
+
+static void elf_parse_module(const char *module)
+{
+ Elf_Ehdr ehdr;
+ Elf_Shdr shdr;
+ FILE *fp;
+ int ret, i;
+ char *str;
+ size_t str_size;
+ char *info;
+ size_t info_size;
+
+ fp = fopen(module, "r");
+ if (NULL == fp) {
+ fprintf(stderr, "open %s: %s\n", module, strerror(errno));
+ exit(1);
+ }
+
+ ret = fread(&ehdr, sizeof(ehdr), 1, fp);
+ if (ret != 1) {
+ fprintf(stderr, "read error (%s)\n", module);
+ exit(1);
+ }
+
+ if (ehdr.e_ident[EI_MAG0] != ELFMAG0 ||
+ ehdr.e_ident[EI_MAG1] != ELFMAG1 ||
+ ehdr.e_ident[EI_MAG2] != ELFMAG2 ||
+ ehdr.e_ident[EI_MAG3] != ELFMAG3) {
+ fprintf(stderr, "not an elf file (%s)\n", module);
+ exit(1);
+ }
+ if (ehdr.e_ident[EI_CLASS] != ELFCLASS64) {
+ fprintf(stderr, "elf class mismatch (%s)\n", module);
+ exit(1);
+ }
+ if (ehdr.e_shoff == 0) {
+ fprintf(stderr, "no section header (%s)\n", module);
+ exit(1);
+ }
+
+ /* read string table */
+ if (ehdr.e_shstrndx == 0) {
+ fprintf(stderr, "no section strings (%s)\n", module);
+ exit(1);
+ }
+ str = elf_read_section(fp, &ehdr, ehdr.e_shstrndx, &str_size);
+ if (NULL == str) {
+ fprintf(stderr, "no section strings (%s)\n", module);
+ exit(1);
+ }
+
+ /* find and read modinfo section */
+ info = NULL;
+ for (i = 0; i < ehdr.e_shnum; i++) {
+ elf_read_section_hdr(fp, &ehdr, i, &shdr);
+ if (!shdr.sh_name) {
+ continue;
+ }
+ if (strcmp(str + shdr.sh_name, ".modinfo") == 0) {
+ info = elf_read_section(fp, &ehdr, i, &info_size);
+ }
+ }
+
+ if (info) {
+ modinfo(module, info, info_size);
+ }
+
+ fclose(fp);
+}
+
+int main(int argc, char **argv)
+{
+ char *pattern;
+ glob_t files;
+ int ret, i;
+
+ if (argc > 1) {
+ moddir = argv[1];
+ }
+
+ pattern = g_strdup_printf("%s/*%s", moddir, dsosuf);
+ ret = glob(pattern, 0, NULL, &files);
+ if (ret != 0) {
+ fprintf(stderr, "glob(%s) failed: %d\n", pattern, ret);
+ exit(1);
+ }
+
+ for (i = 0; i < files.gl_pathc; i++) {
+ elf_parse_module(files.gl_pathv[i]);
+ }
+
+ globfree(&files);
+ g_free(pattern);
+ return 0;
+}
diff --git a/meson.build b/meson.build
index a45f1a844f13..179e92aa7ae1 100644
--- a/meson.build
+++ b/meson.build
@@ -2358,6 +2358,9 @@ if xkbcommon.found()
dependencies: [qemuutil, xkbcommon], install: have_tools)
endif
+qemu_modinfo = executable('qemu-modinfo', files('qemu-modinfo.c') + genh,
+ dependencies: [glib], install: have_tools)
+
if have_tools
qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
dependencies: [authz, block, crypto, io, qom, qemuutil], install: true)
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/9] virtio-gpu module annotations
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 1/9] Add module metadata macros, add qxl module annotations Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 2/9] add qemu-modinfo utility Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 4/9] chardev " Gerd Hoffmann
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/vhost-user-gpu-pci.c | 1 +
hw/display/vhost-user-gpu.c | 1 +
hw/display/vhost-user-vga.c | 1 +
hw/display/virtio-gpu-base.c | 1 +
hw/display/virtio-gpu-gl.c | 3 +++
hw/display/virtio-gpu-pci-gl.c | 3 +++
hw/display/virtio-gpu-pci.c | 2 ++
hw/display/virtio-gpu.c | 1 +
hw/display/virtio-vga-gl.c | 3 +++
hw/display/virtio-vga.c | 2 ++
10 files changed, 18 insertions(+)
diff --git a/hw/display/vhost-user-gpu-pci.c b/hw/display/vhost-user-gpu-pci.c
index a02b23ecaf11..daefcf710159 100644
--- a/hw/display/vhost-user-gpu-pci.c
+++ b/hw/display/vhost-user-gpu-pci.c
@@ -43,6 +43,7 @@ static const VirtioPCIDeviceTypeInfo vhost_user_gpu_pci_info = {
.instance_size = sizeof(VhostUserGPUPCI),
.instance_init = vhost_user_gpu_pci_initfn,
};
+module_obj(TYPE_VHOST_USER_GPU_PCI);
static void vhost_user_gpu_pci_register_types(void)
{
diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index 6cdaa1c73b9b..32ef0061f924 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -596,6 +596,7 @@ static const TypeInfo vhost_user_gpu_info = {
.instance_finalize = vhost_user_gpu_instance_finalize,
.class_init = vhost_user_gpu_class_init,
};
+module_obj(TYPE_VHOST_USER_GPU);
static void vhost_user_gpu_register_types(void)
{
diff --git a/hw/display/vhost-user-vga.c b/hw/display/vhost-user-vga.c
index a34a99856d73..072c9c65bc75 100644
--- a/hw/display/vhost-user-vga.c
+++ b/hw/display/vhost-user-vga.c
@@ -44,6 +44,7 @@ static const VirtioPCIDeviceTypeInfo vhost_user_vga_info = {
.instance_size = sizeof(VhostUserVGA),
.instance_init = vhost_user_vga_inst_initfn,
};
+module_obj(TYPE_VHOST_USER_VGA);
static void vhost_user_vga_register_types(void)
{
diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index dd294276cb38..c8da4806e0bb 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -256,6 +256,7 @@ static const TypeInfo virtio_gpu_base_info = {
.class_init = virtio_gpu_base_class_init,
.abstract = true
};
+module_obj(TYPE_VIRTIO_GPU_BASE);
static void
virtio_register_types(void)
diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
index d971b480806a..7ab93bf8c829 100644
--- a/hw/display/virtio-gpu-gl.c
+++ b/hw/display/virtio-gpu-gl.c
@@ -154,6 +154,7 @@ static const TypeInfo virtio_gpu_gl_info = {
.instance_size = sizeof(VirtIOGPUGL),
.class_init = virtio_gpu_gl_class_init,
};
+module_obj(TYPE_VIRTIO_GPU_GL);
static void virtio_register_types(void)
{
@@ -161,3 +162,5 @@ static void virtio_register_types(void)
}
type_init(virtio_register_types)
+
+module_dep("hw-display-virtio-gpu");
diff --git a/hw/display/virtio-gpu-pci-gl.c b/hw/display/virtio-gpu-pci-gl.c
index 902dda345275..99b14a07185e 100644
--- a/hw/display/virtio-gpu-pci-gl.c
+++ b/hw/display/virtio-gpu-pci-gl.c
@@ -46,6 +46,7 @@ static const VirtioPCIDeviceTypeInfo virtio_gpu_gl_pci_info = {
.instance_size = sizeof(VirtIOGPUGLPCI),
.instance_init = virtio_gpu_gl_initfn,
};
+module_obj(TYPE_VIRTIO_GPU_GL_PCI);
static void virtio_gpu_gl_pci_register_types(void)
{
@@ -53,3 +54,5 @@ static void virtio_gpu_gl_pci_register_types(void)
}
type_init(virtio_gpu_gl_pci_register_types)
+
+module_dep("hw-display-virtio-gpu-pci");
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index d742a30aecf7..e36eee0c409b 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -64,6 +64,7 @@ static const TypeInfo virtio_gpu_pci_base_info = {
.class_init = virtio_gpu_pci_base_class_init,
.abstract = true
};
+module_obj(TYPE_VIRTIO_GPU_PCI_BASE);
#define TYPE_VIRTIO_GPU_PCI "virtio-gpu-pci"
typedef struct VirtIOGPUPCI VirtIOGPUPCI;
@@ -90,6 +91,7 @@ static const VirtioPCIDeviceTypeInfo virtio_gpu_pci_info = {
.instance_size = sizeof(VirtIOGPUPCI),
.instance_init = virtio_gpu_initfn,
};
+module_obj(TYPE_VIRTIO_GPU_PCI);
static void virtio_gpu_pci_register_types(void)
{
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 4d549377cbc1..68fd607c2711 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1419,6 +1419,7 @@ static const TypeInfo virtio_gpu_info = {
.class_size = sizeof(VirtIOGPUClass),
.class_init = virtio_gpu_class_init,
};
+module_obj(TYPE_VIRTIO_GPU);
static void virtio_register_types(void)
{
diff --git a/hw/display/virtio-vga-gl.c b/hw/display/virtio-vga-gl.c
index c971340ebb1a..f22549097c5e 100644
--- a/hw/display/virtio-vga-gl.c
+++ b/hw/display/virtio-vga-gl.c
@@ -36,6 +36,7 @@ static VirtioPCIDeviceTypeInfo virtio_vga_gl_info = {
.instance_size = sizeof(VirtIOVGAGL),
.instance_init = virtio_vga_gl_inst_initfn,
};
+module_obj(TYPE_VIRTIO_VGA_GL);
static void virtio_vga_register_types(void)
{
@@ -45,3 +46,5 @@ static void virtio_vga_register_types(void)
}
type_init(virtio_vga_register_types)
+
+module_dep("hw-display-virtio-vga");
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index d3c640406152..9e57f61e9edb 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -239,6 +239,7 @@ static TypeInfo virtio_vga_base_info = {
.class_init = virtio_vga_base_class_init,
.abstract = true,
};
+module_obj(TYPE_VIRTIO_VGA_BASE);
#define TYPE_VIRTIO_VGA "virtio-vga"
@@ -268,6 +269,7 @@ static VirtioPCIDeviceTypeInfo virtio_vga_info = {
.instance_size = sizeof(VirtIOVGA),
.instance_init = virtio_vga_inst_initfn,
};
+module_obj(TYPE_VIRTIO_VGA);
static void virtio_vga_register_types(void)
{
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/9] chardev module annotations
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
` (2 preceding siblings ...)
2021-06-02 9:17 ` [PATCH 3/9] virtio-gpu module annotations Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 5/9] audio " Gerd Hoffmann
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
chardev/baum.c | 1 +
chardev/spice.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/chardev/baum.c b/chardev/baum.c
index 5deca778bc44..79d618e35045 100644
--- a/chardev/baum.c
+++ b/chardev/baum.c
@@ -680,6 +680,7 @@ static const TypeInfo char_braille_type_info = {
.instance_finalize = char_braille_finalize,
.class_init = char_braille_class_init,
};
+module_obj(TYPE_CHARDEV_BRAILLE);
static void register_types(void)
{
diff --git a/chardev/spice.c b/chardev/spice.c
index 1104426e3a11..3ffb3fdc0dac 100644
--- a/chardev/spice.c
+++ b/chardev/spice.c
@@ -366,6 +366,7 @@ static const TypeInfo char_spice_type_info = {
.class_init = char_spice_class_init,
.abstract = true,
};
+module_obj(TYPE_CHARDEV_SPICE);
static void char_spicevmc_class_init(ObjectClass *oc, void *data)
{
@@ -396,6 +397,7 @@ static const TypeInfo char_spiceport_type_info = {
.parent = TYPE_CHARDEV_SPICE,
.class_init = char_spiceport_class_init,
};
+module_obj(TYPE_CHARDEV_SPICEPORT);
static void register_types(void)
{
@@ -405,3 +407,5 @@ static void register_types(void)
}
type_init(register_types);
+
+module_dep("ui-spice-core");
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/9] audio module annotations
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
` (3 preceding siblings ...)
2021-06-02 9:17 ` [PATCH 4/9] chardev " Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 6/9] usb-redir " Gerd Hoffmann
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
audio/spiceaudio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
index 999bfbde47c5..a8d370fe6f31 100644
--- a/audio/spiceaudio.c
+++ b/audio/spiceaudio.c
@@ -317,3 +317,5 @@ static void register_audio_spice(void)
audio_driver_register(&spice_audio_driver);
}
type_init(register_audio_spice);
+
+module_dep("ui-spice-core");
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/9] usb-redir module annotations
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
` (4 preceding siblings ...)
2021-06-02 9:17 ` [PATCH 5/9] audio " Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 7/9] ccid " Gerd Hoffmann
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/redirect.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 6a75b0dc4ab2..4ec9326e0582 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -2608,6 +2608,7 @@ static const TypeInfo usbredir_dev_info = {
.class_init = usbredir_class_initfn,
.instance_init = usbredir_instance_init,
};
+module_obj(TYPE_USB_REDIR);
static void usbredir_register_types(void)
{
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/9] ccid module annotations
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
` (5 preceding siblings ...)
2021-06-02 9:17 ` [PATCH 6/9] usb-redir " Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 8/9] ui " Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 9/9] s390x " Gerd Hoffmann
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/ccid-card-emulated.c | 1 +
hw/usb/ccid-card-passthru.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 5c76bed77aa0..6c8c0355e099 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -612,6 +612,7 @@ static const TypeInfo emulated_card_info = {
.instance_size = sizeof(EmulatedState),
.class_init = emulated_class_initfn,
};
+module_obj(TYPE_EMULATED_CCID);
static void ccid_card_emulated_register_types(void)
{
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index 7212d0d7fb5e..fa3040fb7154 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -414,6 +414,7 @@ static const TypeInfo passthru_card_info = {
.instance_size = sizeof(PassthruState),
.class_init = passthru_class_initfn,
};
+module_obj(TYPE_CCID_PASSTHRU);
static void ccid_card_passthru_register_types(void)
{
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 8/9] ui module annotations
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
` (6 preceding siblings ...)
2021-06-02 9:17 ` [PATCH 7/9] ccid " Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
2021-06-02 9:17 ` [PATCH 9/9] s390x " Gerd Hoffmann
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/egl-headless.c | 4 ++++
ui/gtk.c | 4 ++++
ui/sdl2.c | 4 ++++
ui/spice-app.c | 3 +++
ui/spice-core.c | 4 ++++
5 files changed, 19 insertions(+)
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index da377a74af69..bb94deb568c0 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -213,3 +213,7 @@ static void register_egl(void)
}
type_init(register_egl);
+
+#ifdef CONFIG_OPENGL
+module_dep("chardev-spice");
+#endif
diff --git a/ui/gtk.c b/ui/gtk.c
index 98046f577b9d..0444b3e17171 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2333,3 +2333,7 @@ static void register_gtk(void)
}
type_init(register_gtk);
+
+#ifdef CONFIG_OPENGL
+module_dep("chardev-spice");
+#endif
diff --git a/ui/sdl2.c b/ui/sdl2.c
index a203cb0239e1..24483e6611fd 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -918,3 +918,7 @@ static void register_sdl1(void)
}
type_init(register_sdl1);
+
+#ifdef CONFIG_OPENGL
+module_dep("chardev-spice");
+#endif
diff --git a/ui/spice-app.c b/ui/spice-app.c
index 4325ac2d9c54..641f4a9d53e3 100644
--- a/ui/spice-app.c
+++ b/ui/spice-app.c
@@ -221,3 +221,6 @@ static void register_spice_app(void)
}
type_init(register_spice_app);
+
+module_dep("ui-spice-core");
+module_dep("chardev-spice");
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 272d19b0c152..a78188042578 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -1037,3 +1037,7 @@ static void spice_register_config(void)
qemu_add_opts(&qemu_spice_opts);
}
opts_init(spice_register_config);
+
+#ifdef CONFIG_OPENGL
+module_dep("chardev-spice");
+#endif
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 9/9] s390x module annotations
2021-06-02 9:17 [PATCH 0/9] [RFC] store module metadata in .modinfo elf section Gerd Hoffmann
` (7 preceding siblings ...)
2021-06-02 9:17 ` [PATCH 8/9] ui " Gerd Hoffmann
@ 2021-06-02 9:17 ` Gerd Hoffmann
8 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2021-06-02 9:17 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
Richard Henderson, armbru, Halil Pasic, Christian Borntraeger,
qemu-s390x, Paolo Bonzini, Michael S. Tsirkin, Gerd Hoffmann,
Samuel Thibault, Marc-André Lureau
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/s390x/virtio-ccw-gpu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c
index 75a9e4bb3908..5868a2a07093 100644
--- a/hw/s390x/virtio-ccw-gpu.c
+++ b/hw/s390x/virtio-ccw-gpu.c
@@ -59,6 +59,7 @@ static const TypeInfo virtio_ccw_gpu = {
.instance_init = virtio_ccw_gpu_instance_init,
.class_init = virtio_ccw_gpu_class_init,
};
+module_obj(TYPE_VIRTIO_GPU_CCW);
static void virtio_ccw_gpu_register(void)
{
@@ -68,3 +69,5 @@ static void virtio_ccw_gpu_register(void)
}
type_init(virtio_ccw_gpu_register)
+
+module_arch("s390x");
--
2.31.1
^ permalink raw reply related [flat|nested] 10+ messages in thread