qemu-cr16/block
Kevin Wolf bf627788ef file-posix: Probe paths and retry SG_IO on potential path errors
When scsi-block is used on a host multipath device, it runs into the
problem that the kernel dm-mpath doesn't know anything about SCSI or
SG_IO and therefore can't decide if a SG_IO request returned an error
and needs to be retried on a different path. Instead of getting working
failover, an error is returned to scsi-block and handled according to
the configured error policy. Obviously, this is not what users want,
they want working failover.

QEMU can parse the SG_IO result and determine whether this could have
been a path error, but just retrying the same request could just send it
to the same failing path again and result in the same error.

With a kernel that supports the DM_MPATH_PROBE_PATHS ioctl on dm-mpath
block devices (queued in the device mapper tree for Linux 6.16), we can
tell the kernel to probe all paths and tell us if any usable paths
remained. If so, we can now retry the SG_IO ioctl and expect it to be
sent to a working path.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20250522130803.34738-1-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2025-05-22 17:56:50 +02:00
..
export block/export: Add option to allow export of inactive nodes 2025-02-06 14:46:40 +01:00
monitor nbd/server: Allow users to adjust handshake limit in QMP 2025-02-11 13:45:47 -06:00
accounting.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
aio_task.c block: Remove unused aio_task_pool_empty 2024-09-30 10:53:18 +03:00
amend.c
backup.c blockdev-backup: Add error handling option for copy-before-write jobs 2025-05-12 18:19:31 +03:00
blkdebug.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
blkio.c include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
blklogwrites.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
blkreplay.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
blkverify.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
block-backend.c block: Remove unused blk_op_is_blocked() 2025-03-11 15:49:14 +01:00
block-copy.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
block-gen.h
block-ram-registrar.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
bochs.c
cloop.c
commit.c block: allow commit to unmap zero blocks 2025-05-01 12:12:19 +03:00
copy-before-write.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
copy-before-write.h blockdev-backup: Add error handling option for copy-before-write jobs 2025-05-12 18:19:31 +03:00
copy-on-read.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
copy-on-read.h
coroutines.h block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
create.c qemu/compiler: Absorb 'clang-tsa.h' 2025-03-06 14:21:25 +01:00
crypto.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
crypto.h
curl.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
dirty-bitmap.c
dmg-bz2.c
dmg-lzfse.c
dmg.c
dmg.h
file-posix.c file-posix: Probe paths and retry SG_IO on potential path errors 2025-05-22 17:56:50 +02:00
file-win32.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
filter-compress.c
gluster.c file-posix, gluster: Handle zero block status hint better 2025-05-14 15:49:27 -05:00
graph-lock.c
io.c block: Add new bdrv_co_is_all_zeroes() function 2025-05-14 16:08:23 -05:00
io_uring.c file-posix: Support FUA writes 2025-03-13 17:44:55 +01:00
iscsi-opts.c
iscsi.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
linux-aio.c file-posix: Support FUA writes 2025-03-13 17:44:55 +01:00
meson.build include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
mirror.c mirror: Reduce I/O when destination is detect-zeroes:unmap 2025-05-14 21:27:04 -05:00
nbd.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
nfs.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
null.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
nvme.c block/nvme: Use host PCI MMIO API 2025-05-08 10:21:10 -04:00
parallels-ext.c qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix 2024-09-10 14:02:16 +02:00
parallels.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
parallels.h
preallocate.c
progress_meter.c
qapi-system.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qapi.c Block layer patches 2025-02-10 13:25:36 -05:00
qcow.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
qcow2-bitmap.c block/qcow2-bitmap: Replace g_memdup() by g_memdup2() 2024-05-08 19:11:34 +02:00
qcow2-cache.c
qcow2-cluster.c
qcow2-refcount.c
qcow2-snapshot.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
qcow2-threads.c
qcow2.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
qcow2.h
qed-check.c
qed-cluster.c
qed-l2-cache.c
qed-table.c
qed.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
qed.h
quorum.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
raw-format.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
rbd.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
replication.c blockdev-backup: Add error handling option for copy-before-write jobs 2025-05-12 18:19:31 +03:00
reqlist.c block/reqlist: allow adding overlapping requests 2024-09-30 10:53:18 +03:00
snapshot-access.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
snapshot.c block: Zero block driver state before reopening 2025-03-11 15:49:14 +01:00
ssh.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
stream.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
throttle-groups.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
throttle.c
trace-events
trace.h
vdi.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
vhdx-endian.c
vhdx-log.c
vhdx.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
vhdx.h
vmdk.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
vpc.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
vvfat.c block: Expand block status mode from bool to flags 2025-05-14 15:33:34 -05:00
win32-aio.c
write-threshold.c