qemu-patch-raspberry4/include/block
Fam Zheng 751ebd76e6 blockjob: Allow nested pause
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.

[Extended doc comments as suggested by Paolo Bonzini
<pbonzini@redhat.com>.
--Stefan]

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 1428069921-2957-2-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-04-28 15:36:09 +02:00
..
accounting.h block: add accounting for merged requests 2015-02-06 17:24:21 +01:00
aio.h AioContext: acquire/release AioContext during aio_poll 2015-04-28 15:36:08 +02:00
block.h block: Drop bdrv_find 2015-03-16 12:10:30 -04:00
block_int.h block: add bdrv functions for geometry and blocksize 2015-03-10 14:02:21 +01:00
blockjob.h blockjob: Allow nested pause 2015-04-28 15:36:09 +02:00
coroutine.h coroutine: drop qemu_coroutine_adjust_pool_size 2015-01-13 13:43:29 +00:00
coroutine_int.h coroutine: Clean up qemu_coroutine_enter() 2015-03-09 11:11:59 +01:00
nbd.h nbd: Set block size to BDRV_SECTOR_SIZE 2015-03-18 12:07:01 +01:00
qapi.h block/qapi: Convert qmp_query_block() to BlockBackend 2014-10-20 14:03:50 +02:00
scsi.h scsi: Print command name in debug 2014-06-18 08:47:10 +02:00
snapshot.h qemu-nbd: support internal snapshot export 2013-12-04 15:19:00 +01:00
thread-pool.h block: Rename BlockDriverCompletionFunc to BlockCompletionFunc 2014-10-20 13:41:27 +02:00
write-threshold.h block: add event when disk usage exceeds threshold 2015-02-06 17:24:21 +01:00