Skip to content

block: Add retry for werror=/rerror= mechanism

Jiahui Cen qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest9 patches 11 repliesIn review
  2. v47 patches 4 repliesSuperseded

Changes in v5 from the cover letter

* Add document for 'retry' in qapi.
* Support werror=/rerror=retry for scsi-disk.
* Pause retry when draining.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9qapi/block-core: Add retry option for error actionblockdev.c qapi/block-core.json+9 -21 reply
2/9block-backend: Introduce retry timerblock/block-backend.c+21 -00 replies
3/9block-backend: Add device specific retry callbackblock/block-backend.c include/sysemu/block-backend.h+12 -01 reply
4/9block-backend: Enable retry action on errorsblock/block-backend.c+9 -01 reply
5/9block-backend: Add timeout support for retryblock/block-backend.c include/sysemu/block-backend.h+25 -10 replies
6/9block: Add error retry param settingblock/block-backend.c blockdev.c hw/block/block.c +2 more+81 -41 reply
7/9virtio_blk: Add support for retry on errorshw/block/virtio-blk.c+18 -30 replies
8/9scsi-bus: Refactor the code that retries requestshw/scsi/scsi-bus.c include/hw/scsi/scsi.h+12 -50 replies
9/9scsi-disk: Add support for retry on errorshw/scsi/scsi-disk.c+16 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism

A VM in the cloud environment may use a virutal disk as the backend storage, and there are usually filesystems on the virtual block device. When backend storage is temporarily down, any I/O issued to the virtual block device will cause an error. For example, an error occurred in ext4 filesystem would make the filesystem readonly. In production environment, a cloud backend storage can be soon recovered. For example, an IP-SAN may be down due to network failure and will be online soon after network is recovered. However, the error in the filesystem may not be recovered unless a device reattach or system restart. Thus an I/O retry mechanism is in need to implement a self-healing system.

This patch series propose to extend the werror=/rerror= mechanism to add a 'retry' feature. It can automatically retry failed I/O requests on error without sending error back to guest, and guest can get back running smoothly when I/O is recovred.

v4->v5:
* Add document for 'retry' in qapi.
* Support werror=/rerror=retry for scsi-disk.
* Pause retry when draining.

v3->v4:
* Adapt to werror=/rerror= mechanism.

v2->v3:
* Add a doc to describe I/O hang.

v1->v2:
* Rebase to fix compile problems.
* Fix incorrect remove of rehandle list.
* Provide rehandle pause interface.

REF: https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg06560.html

Jiahui Cen (9):
qapi/block-core: Add retry option for error action
block-backend: Introduce retry timer
block-backend: Add device specific retry callback
block-backend: Enable retry action on errors
block-backend: Add timeout support for retry
block: Add error retry param setting
virtio_blk: Add support for retry on errors
scsi-bus: Refactor the code that retries requests
scsi-disk: Add support for retry on errors

 block/block-backend.c          | 68 ++++++++++++++++++++
 blockdev.c                     | 52 +++++++++++++++
 hw/block/block.c               | 10 +++
 hw/block/virtio-blk.c          | 21 +++++-
 hw/scsi/scsi-bus.c             | 16 +++--
 hw/scsi/scsi-disk.c            | 16 +++++
 include/hw/block/block.h       |  7 +-
 include/hw/scsi/scsi.h         |  1 +
 include/sysemu/block-backend.h | 10 +++
 qapi/block-core.json           |  9 ++-
 10 files changed, 199 insertions(+), 11 deletions(-)
Signature · 1 line
2.29.2