[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 3/9] block-backend: Add device specific retry callback
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v5 3/9] block-backend: Add device specific retry callback |
Date: |
Mon, 22 Feb 2021 17:24:11 +0000 |
On Fri, Feb 05, 2021 at 06:13:09PM +0800, Jiahui Cen wrote:
> Add retry_request_cb in BlockDevOps to do device specific retry action.
> Backend's timer would be registered only when the backend is set 'retry'
> on errors and the device supports retry action.
>
> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
> Signed-off-by: Ying Fang <fangying1@huawei.com>
> ---
> block/block-backend.c | 8 ++++++++
> include/sysemu/block-backend.h | 4 ++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/block/block-backend.c b/block/block-backend.c
> index 3a9d55cbe3..a8bfaf6e4a 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -995,6 +995,14 @@ void blk_set_dev_ops(BlockBackend *blk, const
> BlockDevOps *ops,
> blk->dev_ops = ops;
> blk->dev_opaque = opaque;
>
> + if ((blk->on_read_error == BLOCKDEV_ON_ERROR_RETRY ||
> + blk->on_write_error == BLOCKDEV_ON_ERROR_RETRY) &&
> + ops->retry_request_cb) {
> + blk->retry_timer = aio_timer_new(blk->ctx, QEMU_CLOCK_REALTIME,
> + SCALE_MS, ops->retry_request_cb,
> + opaque);
> + }
I didn't see anything that handles AioContext changes. If the
BlockBackend is detached from the current AioContext and attached to a
different one, then it is necessary to delete the old timer and create
a new one.
Stefan
signature.asc
Description: PGP signature
- [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism, Jiahui Cen, 2021/02/05
- [PATCH v5 2/9] block-backend: Introduce retry timer, Jiahui Cen, 2021/02/05
- [PATCH v5 8/9] scsi-bus: Refactor the code that retries requests, Jiahui Cen, 2021/02/05
- [PATCH v5 1/9] qapi/block-core: Add retry option for error action, Jiahui Cen, 2021/02/05
- [PATCH v5 7/9] virtio_blk: Add support for retry on errors, Jiahui Cen, 2021/02/05
- [PATCH v5 5/9] block-backend: Add timeout support for retry, Jiahui Cen, 2021/02/05
- [PATCH v5 9/9] scsi-disk: Add support for retry on errors, Jiahui Cen, 2021/02/05
- [PATCH v5 3/9] block-backend: Add device specific retry callback, Jiahui Cen, 2021/02/05
- Re: [PATCH v5 3/9] block-backend: Add device specific retry callback,
Stefan Hajnoczi <=
- [PATCH v5 6/9] block: Add error retry param setting, Jiahui Cen, 2021/02/05
- [PATCH v5 4/9] block-backend: Enable retry action on errors, Jiahui Cen, 2021/02/05
- Re: [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism, Jiahui Cen, 2021/02/09
- Re: [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism, Stefan Hajnoczi, 2021/02/22
- Re: [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism, Stefan Hajnoczi, 2021/02/23