Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/qemu
base: 2a6ae6915454
Choose a base ref
...
head repository: qemu/qemu
compare: 0618e72d64e4
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jul 4, 2023

  1. block/blkio: fix module_block.py parsing

    When QEMU is built with --enable-modules, the module_block.py script
    parses block/*.c to find block drivers that are built as modules. The
    script generates a table of block drivers called block_driver_modules[].
    This table is used for block driver module loading.
    
    The blkio.c driver uses macros to define its BlockDriver structs. This
    was done to avoid code duplication but the module_block.py script is
    unable to parse the macro. The result is that libblkio-based block
    drivers can be built as modules but will not be found at runtime.
    
    One fix is to make the module_block.py script or build system fancier so
    it can parse C macros (e.g. by parsing the preprocessed source code). I
    chose not to do this because it raises the complexity of the build,
    making future issues harder to debug.
    
    Keep things simple: use the macro to avoid duplicating BlockDriver
    function pointers but define .format_name and .protocol_name manually
    for each BlockDriver. This way the module_block.py is able to parse the
    code.
    
    Also get rid of the block driver name macros (e.g. DRIVER_IO_URING)
    because module_block.py cannot parse them either.
    
    Fixes: fd66dbd ("blkio: add libblkio block driver")
    Reported-by: Qing Wang <qinwang@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
    Message-id: 20230704123436.187761-1-stefanha@redhat.com
    Cc: Stefano Garzarella <sgarzare@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Stefan Hajnoczi committed Jul 4, 2023
    Copy the full SHA
    c21eae1 View commit details
    Browse the repository at this point in the history
  2. Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu in…

    …to staging
    
    Pull request
    
    Fix --enable-modules with the blkio block driver.
    
    # -----BEGIN PGP SIGNATURE-----
    #
    # iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmSkOtQACgkQnKSrs4Gr
    # c8ipnQgAqrcwgJliN9wMopm5bFEiHkAppvGz/+qliEpQI5X7xt+YGhcEx7O7ZNMu
    # uSz47y5uQwNNbh4HA51gUkSopAcfH2FP8rD/FH5x7D7mmR3M61AH5LEzzlBbnneW
    # ZtuGSNIvV23mTlQOHqNOGQxV9k3QGrXfxQz0Hy4NKP6jiC1zNdAsCXC8dj9Fda+M
    # nobFXe21qhm0YHYGVgLurbjlTY3aBxL3SOSG550OjQT1Prpi+rw26aK0Gtg1jWL/
    # ynGEgxgUjvO2uqZk71NN5Xr6CLe/SLO9cdIeuhwXffna5uf80S254fMhr9Yr1h52
    # P5UFi4iQZi//fprGD72a6eyogdSzUg==
    # =USrv
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Tue 04 Jul 2023 05:29:24 PM CEST
    # gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
    # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
    # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
    
    * tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
      block/blkio: fix module_block.py parsing
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    rth7680 committed Jul 4, 2023
    Copy the full SHA
    0618e72 View commit details
    Browse the repository at this point in the history