[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 4/9] block-backend: Enable retry action on errors
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v5 4/9] block-backend: Enable retry action on errors |
Date: |
Mon, 22 Feb 2021 17:12:42 +0000 |
On Fri, Feb 05, 2021 at 06:13:10PM +0800, Jiahui Cen wrote:
> Enable retry action when backend's retry timer is available. It would
> trigger the timer to do device specific retry action.
>
> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
> Signed-off-by: Ying Fang <fangying1@huawei.com>
> ---
> block/block-backend.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/block/block-backend.c b/block/block-backend.c
> index a8bfaf6e4a..ab75cb1971 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -1803,6 +1803,9 @@ BlockErrorAction blk_get_error_action(BlockBackend
> *blk, bool is_read,
> return BLOCK_ERROR_ACTION_REPORT;
> case BLOCKDEV_ON_ERROR_IGNORE:
> return BLOCK_ERROR_ACTION_IGNORE;
> + case BLOCKDEV_ON_ERROR_RETRY:
> + return (blk->retry_timer) ?
> + BLOCK_ERROR_ACTION_RETRY : BLOCK_ERROR_ACTION_REPORT;
> case BLOCKDEV_ON_ERROR_AUTO:
> default:
> abort();
> @@ -1850,6 +1853,12 @@ void blk_error_action(BlockBackend *blk,
> BlockErrorAction action,
> qemu_system_vmstop_request_prepare();
> send_qmp_error_event(blk, action, is_read, error);
> qemu_system_vmstop_request(RUN_STATE_IO_ERROR);
> + } else if (action == BLOCK_ERROR_ACTION_RETRY) {
> + if (!blk->quiesce_counter) {
> + timer_mod(blk->retry_timer,
> qemu_clock_get_ms(QEMU_CLOCK_REALTIME) +
> + blk->retry_interval);
QEMU should not make any guest-visible changes while the guest is
stopped (vm_stop()). Please use QEMU_CLOCK_VIRTUAL so the timer does not
fire while the guest is stopped.
Stefan
signature.asc
Description: PGP signature
- [PATCH v5 1/9] qapi/block-core: Add retry option for error action, (continued)
- [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
- [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 4/9] block-backend: Enable retry action on errors,
Stefan Hajnoczi <=
- 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