qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jose R. Ziviani" <jziviani@suse.de>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, kraxel@redhat.com,
	"Jose R. Ziviani" <jziviani@suse.de>
Subject: [PATCH 0/2] modules: Improve modinfo.c architecture support
Date: Thu, 16 Sep 2021 22:29:02 -0300	[thread overview]
Message-ID: <20210917012904.26544-1-jziviani@suse.de> (raw)

When building a single target, the build system detects the architecture
and generates a modinfo.c with modules related to that arch only.
However, when more than one target is built, modinfo.c is generated with
modules available for each architecture - without any way to know what
arch supports what.

The problem is when executing the target, it will try to load modules
that is not supported by it and will throw errors to users, for
instance:

$ ./configure --enable-modules # all targets
$ ./qemu-system-avr -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-gpu.so: undefined symbol: virtio_vmstate_info
Failed to open module: /.../hw-display-virtio-gpu.so: undefined symbol: virtio_vmstate_info
Failed to open module: /.../hw-display-virtio-gpu-gl.so: undefined symbol: virtio_gpu_ctrl_response
Failed to open module: /.../hw-display-virtio-gpu-pci.so: undefined symbol: virtio_instance_init_common
Failed to open module: /.../hw-display-virtio-gpu-pci.so: undefined symbol: virtio_instance_init_common
Failed to open module: /.../hw-display-virtio-gpu-pci-gl.so: undefined symbol: virtio_instance_init_common
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
...

$ ./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

This patchset tries to improve by collecting the modules are currently
enabled for each target, obtaining information in meson from kconfig
and passing that to modinfo.c, which now uses a list to store supported
architectures for each module.

$ ./qemu-system-s390x -nodefaults -display none -accel tcg -M none -device help | head
Controller/Bridge/Hub devices:
name "pci-bridge", bus PCI, desc "Standard PCI Bridge"
name "pci-bridge-seat", bus PCI, desc "Standard PCI Bridge (multiseat)"
...

$ ./qemu-system-avr -nodefaults -display none -accel tcg -M none -device help | head
...
Misc devices:
name "guest-loader", desc "Guest Loader"
name "loader", desc "Generic Loader"

Jose R. Ziviani (2):
  meson: introduce modules_arch
  modules: use a list of supported arch for each module

 hw/display/meson.build      | 48 +++++++++++++++++++++++++++++++++++++
 hw/usb/meson.build          | 36 ++++++++++++++++++++++++++++
 include/qemu/module.h       |  2 +-
 meson.build                 | 19 +++++++++++----
 scripts/modinfo-collect.py  | 10 ++++++++
 scripts/modinfo-generate.py |  7 +++---
 util/module.c               | 18 ++++++++++----
 7 files changed, 125 insertions(+), 15 deletions(-)

-- 
2.33.0



             reply	other threads:[~2021-09-17  1:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  1:29 Jose R. Ziviani [this message]
2021-09-17  1:29 ` [PATCH 1/2] meson: introduce modules_arch Jose R. Ziviani
2021-09-17  7:14   ` Gerd Hoffmann
2021-09-17 13:06     ` Jose R. Ziviani
2021-09-20  5:15       ` Gerd Hoffmann
2021-09-20 13:02         ` Jose R. Ziviani
2021-09-20 19:03           ` Paolo Bonzini
2021-09-21 13:46             ` Jose R. Ziviani
2021-09-23  7:18               ` Paolo Bonzini
2021-09-21  5:25           ` Gerd Hoffmann
2021-09-21 13:35             ` Jose R. Ziviani
2021-09-21 15:34               ` Gerd Hoffmann
2021-09-17  1:29 ` [PATCH 2/2] modules: use a list of supported arch for each module Jose R. Ziviani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210917012904.26544-1-jziviani@suse.de \
    --to=jziviani@suse.de \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).