[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 1/4] blockjob: Allow nested pause
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH v2 1/4] blockjob: Allow nested pause |
Date: |
Wed, 8 Apr 2015 11:31:07 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Apr 03, 2015 at 10:05:18PM +0800, Fam Zheng wrote:
> This patch changes block_job_pause to increase the pause counter and
> block_job_resume to decrease it.
>
> The counter will allow calling block_job_pause/block_job_resume
> unconditionally on a job when we need to suspend the IO temporarily.
>
> From now on, each block_job_resume must be paired with a block_job_pause
> to keep the counter balanced.
>
> The user pause from QMP or HMP will only trigger block_job_pause once
> until it's resumed, this is achieved by adding a user_paused flag in
> BlockJob.
>
> One occurrence of block_job_resume in mirror_complete is replaced with
> block_job_enter which does what is necessary.
>
> In block_job_cancel, the cancel flag is good enough to instruct
> coroutines to quit loop, so use block_job_enter to replace the unpaired
> block_job_resume.
>
> Upon block job IO error, user is notified about the entering to the
> pause state, so this pause belongs to user pause, set the flag
> accordingly and expect a matching QMP resume.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> block/mirror.c | 2 +-
> blockdev.c | 8 +++++---
> blockjob.c | 23 +++++++++++++++++------
> include/block/blockjob.h | 20 ++++++++++++++++----
> 4 files changed, 39 insertions(+), 14 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
pgpjlg53B8wmQ.pgp
Description: PGP signature
- Re: [Qemu-block] [PATCH v2 3/4] qemu-iotests: Test that "stop" doesn't drain block jobs, (continued)
[Qemu-block] [PATCH v2 4/4] blockjob: Update function name in comments, Fam Zheng, 2015/04/03
[Qemu-block] [PATCH v2 1/4] blockjob: Allow nested pause, Fam Zheng, 2015/04/03
[Qemu-block] [PATCH v2 2/4] block: Pause block jobs in bdrv_drain_all, Fam Zheng, 2015/04/03
Re: [Qemu-block] [PATCH v2 0/4] Fix "stop" draining block jobs, Stefan Hajnoczi, 2015/04/08
Re: [Qemu-block] [PATCH v2 0/4] Fix "stop" draining block jobs, Stefan Hajnoczi, 2015/04/20