mirror of https://github.com/xemu-project/xemu.git
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----- Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into 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>
This commit is contained in:
commit
0618e72d64
|
@ -22,16 +22,6 @@
|
||||||
|
|
||||||
#include "block/block-io.h"
|
#include "block/block-io.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* Keep the QEMU BlockDriver names identical to the libblkio driver names.
|
|
||||||
* Using macros instead of typing out the string literals avoids typos.
|
|
||||||
*/
|
|
||||||
#define DRIVER_IO_URING "io_uring"
|
|
||||||
#define DRIVER_NVME_IO_URING "nvme-io_uring"
|
|
||||||
#define DRIVER_VIRTIO_BLK_VFIO_PCI "virtio-blk-vfio-pci"
|
|
||||||
#define DRIVER_VIRTIO_BLK_VHOST_USER "virtio-blk-vhost-user"
|
|
||||||
#define DRIVER_VIRTIO_BLK_VHOST_VDPA "virtio-blk-vhost-vdpa"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocated bounce buffers are kept in a list sorted by buffer address.
|
* Allocated bounce buffers are kept in a list sorted by buffer address.
|
||||||
*/
|
*/
|
||||||
|
@ -744,15 +734,15 @@ static int blkio_file_open(BlockDriverState *bs, QDict *options, int flags,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(blkio_driver, DRIVER_IO_URING) == 0) {
|
if (strcmp(blkio_driver, "io_uring") == 0) {
|
||||||
ret = blkio_io_uring_open(bs, options, flags, errp);
|
ret = blkio_io_uring_open(bs, options, flags, errp);
|
||||||
} else if (strcmp(blkio_driver, DRIVER_NVME_IO_URING) == 0) {
|
} else if (strcmp(blkio_driver, "nvme-io_uring") == 0) {
|
||||||
ret = blkio_nvme_io_uring(bs, options, flags, errp);
|
ret = blkio_nvme_io_uring(bs, options, flags, errp);
|
||||||
} else if (strcmp(blkio_driver, DRIVER_VIRTIO_BLK_VFIO_PCI) == 0) {
|
} else if (strcmp(blkio_driver, "virtio-blk-vfio-pci") == 0) {
|
||||||
ret = blkio_virtio_blk_common_open(bs, options, flags, errp);
|
ret = blkio_virtio_blk_common_open(bs, options, flags, errp);
|
||||||
} else if (strcmp(blkio_driver, DRIVER_VIRTIO_BLK_VHOST_USER) == 0) {
|
} else if (strcmp(blkio_driver, "virtio-blk-vhost-user") == 0) {
|
||||||
ret = blkio_virtio_blk_common_open(bs, options, flags, errp);
|
ret = blkio_virtio_blk_common_open(bs, options, flags, errp);
|
||||||
} else if (strcmp(blkio_driver, DRIVER_VIRTIO_BLK_VHOST_VDPA) == 0) {
|
} else if (strcmp(blkio_driver, "virtio-blk-vhost-vdpa") == 0) {
|
||||||
ret = blkio_virtio_blk_common_open(bs, options, flags, errp);
|
ret = blkio_virtio_blk_common_open(bs, options, flags, errp);
|
||||||
} else {
|
} else {
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
|
@ -1028,10 +1018,11 @@ static void blkio_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||||
* - truncate
|
* - truncate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BLKIO_DRIVER(name, ...) \
|
/*
|
||||||
{ \
|
* Do not include .format_name and .protocol_name because module_block.py
|
||||||
.format_name = name, \
|
* does not parse macros in the source code.
|
||||||
.protocol_name = name, \
|
*/
|
||||||
|
#define BLKIO_DRIVER_COMMON \
|
||||||
.instance_size = sizeof(BDRVBlkioState), \
|
.instance_size = sizeof(BDRVBlkioState), \
|
||||||
.bdrv_file_open = blkio_file_open, \
|
.bdrv_file_open = blkio_file_open, \
|
||||||
.bdrv_close = blkio_close, \
|
.bdrv_close = blkio_close, \
|
||||||
|
@ -1047,30 +1038,43 @@ static void blkio_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||||
.bdrv_co_pwrite_zeroes = blkio_co_pwrite_zeroes, \
|
.bdrv_co_pwrite_zeroes = blkio_co_pwrite_zeroes, \
|
||||||
.bdrv_refresh_limits = blkio_refresh_limits, \
|
.bdrv_refresh_limits = blkio_refresh_limits, \
|
||||||
.bdrv_register_buf = blkio_register_buf, \
|
.bdrv_register_buf = blkio_register_buf, \
|
||||||
.bdrv_unregister_buf = blkio_unregister_buf, \
|
.bdrv_unregister_buf = blkio_unregister_buf,
|
||||||
__VA_ARGS__ \
|
|
||||||
}
|
|
||||||
|
|
||||||
static BlockDriver bdrv_io_uring = BLKIO_DRIVER(
|
/*
|
||||||
DRIVER_IO_URING,
|
* Use the same .format_name and .protocol_name as the libblkio driver name for
|
||||||
|
* consistency.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static BlockDriver bdrv_io_uring = {
|
||||||
|
.format_name = "io_uring",
|
||||||
|
.protocol_name = "io_uring",
|
||||||
.bdrv_needs_filename = true,
|
.bdrv_needs_filename = true,
|
||||||
);
|
BLKIO_DRIVER_COMMON
|
||||||
|
};
|
||||||
|
|
||||||
static BlockDriver bdrv_nvme_io_uring = BLKIO_DRIVER(
|
static BlockDriver bdrv_nvme_io_uring = {
|
||||||
DRIVER_NVME_IO_URING,
|
.format_name = "nvme-io_uring",
|
||||||
);
|
.protocol_name = "nvme-io_uring",
|
||||||
|
BLKIO_DRIVER_COMMON
|
||||||
|
};
|
||||||
|
|
||||||
static BlockDriver bdrv_virtio_blk_vfio_pci = BLKIO_DRIVER(
|
static BlockDriver bdrv_virtio_blk_vfio_pci = {
|
||||||
DRIVER_VIRTIO_BLK_VFIO_PCI
|
.format_name = "virtio-blk-vfio-pci",
|
||||||
);
|
.protocol_name = "virtio-blk-vfio-pci",
|
||||||
|
BLKIO_DRIVER_COMMON
|
||||||
|
};
|
||||||
|
|
||||||
static BlockDriver bdrv_virtio_blk_vhost_user = BLKIO_DRIVER(
|
static BlockDriver bdrv_virtio_blk_vhost_user = {
|
||||||
DRIVER_VIRTIO_BLK_VHOST_USER
|
.format_name = "virtio-blk-vhost-user",
|
||||||
);
|
.protocol_name = "virtio-blk-vhost-user",
|
||||||
|
BLKIO_DRIVER_COMMON
|
||||||
|
};
|
||||||
|
|
||||||
static BlockDriver bdrv_virtio_blk_vhost_vdpa = BLKIO_DRIVER(
|
static BlockDriver bdrv_virtio_blk_vhost_vdpa = {
|
||||||
DRIVER_VIRTIO_BLK_VHOST_VDPA
|
.format_name = "virtio-blk-vhost-vdpa",
|
||||||
);
|
.protocol_name = "virtio-blk-vhost-vdpa",
|
||||||
|
BLKIO_DRIVER_COMMON
|
||||||
|
};
|
||||||
|
|
||||||
static void bdrv_blkio_init(void)
|
static void bdrv_blkio_init(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue