Skip to content

Dynamic module support for block drivers

Marc Marí qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 7 repliesIn review
  2. v12 patches 11 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Add dynamic module loading for block driversblock.c configure include/qemu/module.h +2 more+175 -281 reply
2/2Add dynamic generation of module_block.h.gitignore Makefile include/qemu/module_block.h +1 more+142 -932 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/2] Dynamic module support for block drivers

The current module infrastructure has been improved to enable dynamic module loading.

This reduces the load time for very simple guests. For the following configuration (very loaded)

./configure --enable-sdl --enable-gtk --enable-vte --enable-curses \
    --enable-vnc --enable-vnc-{jpeg,tls,sasl,png} --enable-virtfs \
    --enable-brlapi --enable-curl --enable-fdt --enable-bluez \
    --enable-kvm --enable-rdma --enable-uuid --enable-vde \
    --enable-linux-aio --enable-cap-ng --enable-attr --enable-vhost-net \
    --enable-vhost-scsi --enable-spice --enable-rbd --enable-libiscsi \
    --enable-smartcard-nss --enable-guest-agent --enable-libusb \
    --enable-usb-redir --enable-lzo --enable-snappy --enable-bzip2 \
    --enable-seccomp --enable-coroutine-pool --enable-glusterfs \
    --enable-tpm --enable-libssh2 --enable-vhdx --enable-numa \
    --enable-tcmalloc --target-list=x86_64-softmmu

With modules disabled, there are 142 libraries loaded at startup. Time is the following:
LD time: 0.065 seconds
QEMU time: 0.02 seconds
Total time: 0.085 seconds

With this patch series and modules enabled, there are 128 libraries loaded at startup. Time is the following:
LD time: 0.02 seconds
QEMU time: 0.02 seconds
Total time: 0.04 seconds

Where LD time is the time between the program startup and the jump to main, and QEMU time is the time between the start of main and the first kvm_entry.

These results are just with a few block drivers, that were already a module. Adding more modules (block or not block) should be easy, and will reduce the load time even more.

Marc Marí (2):
Add dynamic module loading for block drivers
Add dynamic generation of module_block.h

 .gitignore                      |   1 +
 Makefile                        |  10 ++-
 block.c                         |  70 +++++++++++++++++++++
 configure                       |   2 +-
 include/qemu/module.h           |   3 +
 scripts/modules/module_block.py | 134 ++++++++++++++++++++++++++++++++++++++++
 util/module.c                   |  38 ++++--------
 7 files changed, 227 insertions(+), 31 deletions(-)
 create mode 100755 scripts/modules/module_block.py
Signature · 1 line
2.4.3