Skip to content

modules: Improve modinfo.c support

Jose R. Ziviani qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 4 repliesIn review
  2. v2 posting 2/22 patches 2 repliesSuperseded
  3. v2 posting 1/20 of 2 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches10 repliesSuperseded

Changes in v3 from the cover letter

- Renamed module_needs to module_kconfig [Gerd]
- Reworded the commit message a bit to improve a better understanding [myself]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2modules: introduces module_kconfig directivehw/display/qxl.c hw/display/vhost-user-gpu-pci.c hw/display/vhost-user-gpu.c +15 more+28 -00 replies
2/2modules: generates per-target modinfomeson.build scripts/modinfo-generate.py+42 -250 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchGerd Hoffmann
SeriesA-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] modules: Improve modinfo.c support

This patchset introduces the modinfo_kconfig aiming for a fine-tune control of module loading by simply checking Kconfig options during the compile time, then generates one modinfo-<target>-softmmu.c per target.

The main reason of this change is to fix problems like:

$ ./qemu-system-s390x -nodefaults -display none -accel tcg -M none -device help | head
Failed to open module: /.../hw-display-qxl.so: undefined symbol: vga_ioport_read
Failed to open module: /.../hw-display-virtio-vga.so: undefined symbol: vmstate_vga_common
Failed to open module: /.../hw-display-virtio-vga.so: undefined symbol: vmstate_vga_common
Failed to open module: /.../hw-display-virtio-vga-gl.so: undefined symbol: have_vga
Failed to open module: /.../hw-usb-smartcard.so: undefined symbol: ccid_card_ccid_attach
Failed to open module: /.../hw-usb-redirect.so: undefined symbol: vmstate_usb_device
Failed to open module: /.../hw-usb-host.so: undefined symbol: vmstate_usb_device

With this patch, I run this small script successfuly:

    #!/bin/bash
    pushd ~/suse/virtualization/qemu/build
    for qemu in qemu-system-*
    do
        [[ -f "$qemu" ]] || continue
        res=$(./$qemu -nodefaults -display none -accel tcg -M none -device help 2>&1 | grep "Failed to" > /dev/null; echo $?)
        [[ $res -eq 0 ]] && echo "Error: $qemu"
    done
    popd

Also run 'make check' and 'check-acceptance' without any failures.

v2 -> v3:
- Renamed module_needs to module_kconfig [Gerd]
- Reworded the commit message a bit to improve a better understanding [myself]

v1 -> v2:
- Changed the approach to this problem after suggestions made by Paolo and Gerd.

Thank you!

Jose R. Ziviani (2):
modules: introduces module_kconfig directive
modules: generates per-target modinfo

 hw/display/qxl.c                |  1 +
 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      |  1 +
 hw/display/virtio-gpu-pci-gl.c  |  1 +
 hw/display/virtio-gpu-pci.c     |  1 +
 hw/display/virtio-gpu.c         |  1 +
 hw/display/virtio-vga-gl.c      |  1 +
 hw/display/virtio-vga.c         |  1 +
 hw/s390x/virtio-ccw-gpu.c       |  1 +
 hw/usb/ccid-card-emulated.c     |  1 +
 hw/usb/ccid-card-passthru.c     |  1 +
 hw/usb/host-libusb.c            |  1 +
 hw/usb/redirect.c               |  1 +
 include/qemu/module.h           | 10 ++++++++
 meson.build                     | 25 +++++++++++++-------
 scripts/modinfo-generate.py     | 42 ++++++++++++++++++++-------------
 19 files changed, 69 insertions(+), 24 deletions(-)
Signature · 1 line
2.33.0