qemu-e2k/block
Stefan Hajnoczi fd66dbd424 blkio: add libblkio block driver
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, nvme-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

  --blockdev nvme-io_uring,node-name=drive0,filename=/dev/ng0n1,readonly=on|off,cache.direct=on

  --blockdev virtio-blk-vhost-vdpa,node-name=drive0,path=/dev/vdpa...,readonly=on|off,cache.direct=on

  --blockdev virtio-blk-vhost-user,node-name=drive0,path=vhost-user-blk.sock,readonly=on|off,cache.direct=on

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20221013185908.1297568-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2022-10-26 14:56:42 -04:00
..
export block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
monitor monitor: expose monitor_puts to rest of code 2022-10-06 11:53:40 +01:00
accounting.c block: add missed block_acct_setup with new block device init procedure 2022-09-30 18:42:34 +02:00
aio_task.c
amend.c
backup.c
blkdebug.c
blkio.c blkio: add libblkio block driver 2022-10-26 14:56:42 -04:00
blklogwrites.c block: Change bdrv_{pread,pwrite,pwrite_sync}() param order 2022-07-12 12:14:55 +02:00
blkreplay.c
blkverify.c blkverify: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
block-backend.c block: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
block-copy.c
block-gen.h
bochs.c block: Change bdrv_{pread,pwrite,pwrite_sync}() param order 2022-07-12 12:14:55 +02:00
cloop.c block: Make bdrv_{pread,pwrite}() return 0 on success 2022-07-12 12:14:55 +02:00
commit.c block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
copy-before-write.c copy-before-write: add missing coroutine_fn annotations 2022-10-07 12:11:41 +02:00
copy-before-write.h
copy-on-read.c
copy-on-read.h
coroutines.h block: Remove remaining unused symbols in coroutines.h 2022-07-12 12:14:56 +02:00
create.c
crypto.c block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
crypto.h
curl.c curl: add missing coroutine_fn annotations 2022-10-07 12:11:41 +02:00
dirty-bitmap.c
dmg-bz2.c
dmg-lzfse.c
dmg.c block: Make bdrv_{pread,pwrite}() return 0 on success 2022-07-12 12:14:55 +02:00
dmg.h
file-posix.c file-posix: Remove unused s->discard_zeroes 2022-10-07 12:11:41 +02:00
file-win32.c
filter-compress.c
gluster.c gluster: stop using .bdrv_needs_filename 2022-09-30 18:43:44 +02:00
io_uring.c block/io_uring: add missing include file 2022-08-02 11:01:24 +02:00
io.c block: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
iscsi-opts.c
iscsi.c iscsi: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
linux-aio.c misc: fix commonly doubled up words 2022-08-01 11:58:02 +02:00
meson.build blkio: add libblkio block driver 2022-10-26 14:56:42 -04:00
mirror.c blockjob: protect iostatus field in BlockJob struct 2022-10-07 12:11:41 +02:00
nbd.c nbd: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
nfs.c nfs: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
null.c
nvme.c nvme: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
parallels-ext.c block: Change bdrv_{pread,pwrite,pwrite_sync}() param order 2022-07-12 12:14:55 +02:00
parallels.c parallels: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
parallels.h
preallocate.c
progress_meter.c
qapi-sysemu.c
qapi.c
qcow2-bitmap.c block/qcow2-bitmap: Add missing cast to silent GCC error 2022-09-30 18:02:30 +02:00
qcow2-cache.c block: Change bdrv_{pread,pwrite,pwrite_sync}() param order 2022-07-12 12:14:55 +02:00
qcow2-cluster.c qcow2: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
qcow2-refcount.c qcow2: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
qcow2-snapshot.c block: Use bdrv_co_pwrite_sync() when caller is coroutine_fn 2022-07-12 12:14:56 +02:00
qcow2-threads.c
qcow2.c qcow2: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
qcow2.h qcow2: add missing coroutine_fn annotations 2022-10-07 12:11:40 +02:00
qcow.c block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
qed-check.c
qed-cluster.c
qed-l2-cache.c
qed-table.c
qed.c qed: add missing coroutine_fn annotations 2022-10-07 12:11:41 +02:00
qed.h
quorum.c quorum: Remove unnecessary forward declaration 2022-10-07 12:11:41 +02:00
raw-format.c raw-format: add missing coroutine_fn annotations 2022-10-07 12:11:41 +02:00
rbd.c
replication.c job.c: enable job lock/unlock and remove Aiocontext locks 2022-10-07 12:11:41 +02:00
reqlist.c
snapshot-access.c
snapshot.c
ssh.c
stream.c
throttle-groups.c
throttle.c throttle: add missing coroutine_fn annotations 2022-10-07 12:11:41 +02:00
trace-events
trace.h
vdi.c block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
vhdx-endian.c
vhdx-log.c block: Change bdrv_{pread,pwrite,pwrite_sync}() param order 2022-07-12 12:14:55 +02:00
vhdx.c block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
vhdx.h
vmdk.c vmdk: add missing coroutine_fn annotations 2022-10-07 12:11:41 +02:00
vpc.c block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
vvfat.c block: Change bdrv_{pread,pwrite,pwrite_sync}() param order 2022-07-12 12:14:55 +02:00
win32-aio.c
write-threshold.c