[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 14/45] block: introduce block job error
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 14/45] block: introduce block job error |
Date: |
Thu, 27 Sep 2012 15:41:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 26.09.2012 17:56, schrieb Paolo Bonzini:
> The following behaviors are possible:
>
> 'report': The behavior is the same as in 1.1. An I/O error,
> respectively during a read or a write, will complete the job immediately
> with an error code.
>
> 'ignore': An I/O error, respectively during a read or a write, will be
> ignored. For streaming, the job will complete with an error and the
> backing file will be left in place. For mirroring, the sector will be
> marked again as dirty and re-examined later.
>
> 'stop': The job will be paused and the job iostatus will be set to
> failed or nospace, while the VM will keep running. This can only be
> specified if the block device has rerror=stop and werror=stop or enospc.
Why is that? I don't see the dependency on rerror/werror in the code,
and documentation doesn't mention it either.
> 'enospc': Behaves as 'stop' for ENOSPC errors, 'report' for others.
>
> In all cases, even for 'report', the I/O error is reported as a QMP
> event BLOCK_JOB_ERROR, with the same arguments as BLOCK_IO_ERROR.
>
> It is possible that while stopping the VM a BLOCK_IO_ERROR event will be
> reported and will clobber the event from BLOCK_JOB_ERROR, or vice versa.
> This is not really avoidable since stopping the VM completes all pending
> I/O requests. In fact, it is already possible now that a series of
> BLOCK_IO_ERROR events are reported with rerror=stop, because vm_stop
> calls bdrv_drain_all and this can generate further errors.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> v1->v2: introduced block_job_iostatus_reset. Removed sorting
> of iostatus values with "failed" overriding "nospace" but not
> vice versa. Documented that block-job-resume clears the
> iostatus field. Always set errors on the block job even if
> they happen on the target; this removes the need to expose
> the target's BlockInfo in "query-blockjobs".
> +BlockErrorAction block_job_error_action(BlockJob *job, BlockDriverState *bs,
> + BlockdevOnError on_err,
> + int is_read, int error)
> +{
> + BlockErrorAction action;
> +
> + switch (on_err) {
> + case BLOCKDEV_ON_ERROR_ENOSPC:
> + action = (error == ENOSPC) ? BDRV_ACTION_STOP : BDRV_ACTION_REPORT;
> + break;
> + case BLOCKDEV_ON_ERROR_STOP:
> + action = BDRV_ACTION_STOP;
> + break;
> + case BLOCKDEV_ON_ERROR_REPORT:
> + action = BDRV_ACTION_REPORT;
> + break;
> + case BLOCKDEV_ON_ERROR_IGNORE:
> + action = BDRV_ACTION_IGNORE;
> + break;
> + default:
> + abort();
> + }
Isn't this a duplication of bdrv_get_error_action()?
Kevin
- [Qemu-devel] [PATCH v2 11/45] iostatus: move BlockdevOnError declaration to QAPI, (continued)
- [Qemu-devel] [PATCH v2 11/45] iostatus: move BlockdevOnError declaration to QAPI, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 13/45] iostatus: reorganize io error code, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 10/45] iostatus: rename BlockErrorAction, BlockQMPEventAction, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 12/45] iostatus: change is_read to a bool, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 14/45] block: introduce block job error, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 16/45] blkdebug: process all set_state rules in the old state, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 17/45] qemu-iotests: map underscore to dash in QMP argument names, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 20/45] block: add bdrv_query_stats, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 19/45] block: add bdrv_query_info, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 18/45] qemu-iotests: add tests for streaming error handling, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 22/45] block: introduce new dirty bitmap functionality, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 23/45] block: export dirty bitmap information in query-block, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 26/45] mirror: introduce mirror job, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 24/45] block: add block-job-complete, Paolo Bonzini, 2012/09/26