[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 02/12] blkio: add libblkio block driver
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v5 02/12] blkio: add libblkio block driver |
Date: |
Wed, 28 Sep 2022 07:27:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Stefan Hajnoczi <stefanha@redhat.com> writes:
> libblkio (https://gitlab.com/libblkio/libblkio/) is a library for
> high-performance disk I/O. It currently supports io_uring,
> virtio-blk-vhost-user, and virtio-blk-vhost-vdpa with additional drivers
> under development.
>
> One of the reasons for developing libblkio is that other applications
> besides QEMU can use it. This will be particularly useful for
> virtio-blk-vhost-user which applications may wish to use for connecting
> to qemu-storage-daemon.
>
> libblkio also gives us an opportunity to develop in Rust behind a C API
> that is easy to consume from QEMU.
>
> This commit adds io_uring, virtio-blk-vhost-user, and
> virtio-blk-vhost-vdpa BlockDrivers to QEMU using libblkio. It will be
> easy to add other libblkio drivers since they will share the majority of
> code.
>
> For now I/O buffers are copied through bounce buffers if the libblkio
> driver requires it. Later commits add an optimization for
> pre-registering guest RAM to avoid bounce buffers.
>
> The syntax is:
>
> --blockdev
> io_uring,node-name=drive0,filename=test.img,readonly=on|off,cache.direct=on|off
>
> and:
>
> --blockdev
> virtio-blk-vhost-vdpa,node-name=drive0,path=/dev/vdpa...,readonly=on|off
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> Acked-by: Markus Armbruster <armbru@redhat.com>
[...]
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index f21fa235f2..5aed0dd436 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -2951,11 +2951,16 @@
> 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster',
> {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
> {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
> - 'http', 'https', 'iscsi',
> + 'http', 'https',
> + { 'name': 'io_uring', 'if': 'CONFIG_BLKIO' },
> + 'iscsi',
> 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
> 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
> { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
> - 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
> + 'ssh', 'throttle', 'vdi', 'vhdx',
> + { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' },
> + { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' },
> + 'vmdk', 'vpc', 'vvfat' ] }
>
> ##
> # @BlockdevOptionsFile:
> @@ -3678,6 +3683,42 @@
> '*debug': 'int',
> '*logfile': 'str' } }
>
> +##
> +# @BlockdevOptionsIoUring:
> +#
> +# Driver specific block device options for the io_uring backend.
> +#
> +# @filename: path to the image file
> +#
> +# Since: 7.2
> +##
> +{ 'struct': 'BlockdevOptionsIoUring',
> + 'data': { 'filename': 'str' } }
> +
> +##
> +# @BlockdevOptionsVirtioBlkVhostUser:
> +#
> +# Driver specific block device options for the virtio-blk-vhost-user backend.
> +#
> +# @path: path to the vhost-user UNIX domain socket.
> +#
> +# Since: 7.2
> +##
> +{ 'struct': 'BlockdevOptionsVirtioBlkVhostUser',
> + 'data': { 'path': 'str' } }
> +
> +##
> +# @BlockdevOptionsVirtioBlkVhostVdpa:
> +#
> +# Driver specific block device options for the virtio-blk-vhost-vdpa backend.
> +#
> +# @path: path to the vhost-vdpa character device.
> +#
> +# Since: 7.2
> +##
> +{ 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa',
> + 'data': { 'path': 'str' } }
> +
Should these be 'if': 'CONFIG_BLKIO'?
> ##
> # @IscsiTransport:
> #
> @@ -4305,6 +4346,8 @@
> 'if': 'HAVE_HOST_BLOCK_DEVICE' },
> 'http': 'BlockdevOptionsCurlHttp',
> 'https': 'BlockdevOptionsCurlHttps',
> + 'io_uring': { 'type': 'BlockdevOptionsIoUring',
> + 'if': 'CONFIG_BLKIO' },
> 'iscsi': 'BlockdevOptionsIscsi',
> 'luks': 'BlockdevOptionsLUKS',
> 'nbd': 'BlockdevOptionsNbd',
> @@ -4327,6 +4370,12 @@
> 'throttle': 'BlockdevOptionsThrottle',
> 'vdi': 'BlockdevOptionsGenericFormat',
> 'vhdx': 'BlockdevOptionsGenericFormat',
> + 'virtio-blk-vhost-user':
> + { 'type': 'BlockdevOptionsVirtioBlkVhostUser',
> + 'if': 'CONFIG_BLKIO' },
> + 'virtio-blk-vhost-vdpa':
> + { 'type': 'BlockdevOptionsVirtioBlkVhostVdpa',
> + 'if': 'CONFIG_BLKIO' },
> 'vmdk': 'BlockdevOptionsGenericCOWFormat',
> 'vpc': 'BlockdevOptionsGenericFormat',
> 'vvfat': 'BlockdevOptionsVVFAT'
[...]
- [PATCH v5 00/12] blkio: add libblkio BlockDriver, Stefan Hajnoczi, 2022/09/27
- [PATCH v5 01/12] coroutine: add flag to re-queue at front of CoQueue, Stefan Hajnoczi, 2022/09/27
- [PATCH v5 02/12] blkio: add libblkio block driver, Stefan Hajnoczi, 2022/09/27
- Re: [PATCH v5 02/12] blkio: add libblkio block driver,
Markus Armbruster <=
- [PATCH v5 03/12] numa: call ->ram_block_removed() in ram_block_notifer_remove(), Stefan Hajnoczi, 2022/09/27
- [PATCH v5 05/12] block: use BdrvRequestFlags type for supported flag fields, Stefan Hajnoczi, 2022/09/27
- [PATCH v5 04/12] block: pass size to bdrv_unregister_buf(), Stefan Hajnoczi, 2022/09/27
- [PATCH v5 06/12] block: add BDRV_REQ_REGISTERED_BUF request flag, Stefan Hajnoczi, 2022/09/27
- [PATCH v5 07/12] block: return errors from bdrv_register_buf(), Stefan Hajnoczi, 2022/09/27
- [PATCH v5 08/12] block: add BlockRAMRegistrar, Stefan Hajnoczi, 2022/09/27
- [PATCH v5 09/12] exec/cpu-common: add qemu_ram_get_fd(), Stefan Hajnoczi, 2022/09/27
- [PATCH v5 10/12] stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd(), Stefan Hajnoczi, 2022/09/27
- [PATCH v5 11/12] blkio: implement BDRV_REQ_REGISTERED_BUF optimization, Stefan Hajnoczi, 2022/09/27