qemu/hw/block
Stefan Hajnoczi 41abca8c39 block: add blk_io_plug_call() API
Introduce a new API for thread-local blk_io_plug() that does not
traverse the block graph. The goal is to make blk_io_plug() multi-queue
friendly.

Instead of having block drivers track whether or not we're in a plugged
section, provide an API that allows them to defer a function call until
we're unplugged: blk_io_plug_call(fn, opaque). If blk_io_plug_call() is
called multiple times with the same fn/opaque pair, then fn() is only
called once at the end of the function - resulting in batching.

This patch introduces the API and changes blk_io_plug()/blk_io_unplug().
blk_io_plug()/blk_io_unplug() no longer require a BlockBackend argument
because the plug state is now thread-local.

Later patches convert block drivers to blk_io_plug_call() and then we
can finally remove .bdrv_co_io_plug() once all block drivers have been
converted.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 20230530180959.1108766-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2023-06-01 07:34:03 -04:00
..
dataplane block: add blk_io_plug_call() API 2023-06-01 07:34:03 -04:00
block.c pflash: Fix blk_pread_nonzeroes() 2023-03-07 16:53:18 +01:00
cdrom.c
ecc.c
fdc-internal.h
fdc-isa.c hw: Replace isa_get_irq() by isa_bus_get_irq() when ISABus is available 2023-02-27 22:29:02 +01:00
fdc-sysbus.c
fdc.c hw/block: replace TABs with space 2023-03-24 11:45:46 +01:00
hd-geometry.c
Kconfig
m25p80.c m25p80: Improve error when the backend file size does not match the device 2023-03-07 16:53:18 +01:00
m25p80_sfdp.c
m25p80_sfdp.h
meson.build hw/xen: Build PV backend drivers for CONFIG_XEN_BUS 2023-03-07 17:04:30 +00:00
nand.c hw/block: replace TABs with space 2023-03-24 11:45:46 +01:00
onenand.c hw/block: replace TABs with space 2023-03-24 11:45:46 +01:00
pflash_cfi01.c Drop duplicate #include 2023-02-08 07:28:05 +01:00
pflash_cfi02.c
swim.c
tc58128.c hw/block: replace TABs with space 2023-03-24 11:45:46 +01:00
trace-events virtio-blk: add some trace events for zoned emulation 2023-05-15 08:18:10 -04:00
trace.h
vhost-user-blk.c
virtio-blk-common.c virtio-blk: add zoned storage emulation for zoned devices 2023-05-15 08:18:10 -04:00
virtio-blk.c block: add blk_io_plug_call() API 2023-06-01 07:34:03 -04:00
xen-block.c xen-block: implement BlockDevOps->drained_begin() 2023-05-30 17:32:02 +02:00
xen_blkif.h