diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-30 14:14:48 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-30 14:14:48 +0100 |
commit | 7b6badb6a93956e83135a9b7017997cad6ea7faf (patch) | |
tree | 86898dc7c205ac9ff2facf30a61656f1a97106e3 /include | |
parent | 5bb0d22cb41a366efff662d45bec26ab343b5532 (diff) | |
parent | 223a23c198787328ae75bc65d84edf5fde33c0b6 (diff) |
Merge remote-tracking branch 'jtc/tags/block-pull-request' into staging
# gpg: Signature made Fri 26 May 2017 08:22:27 PM BST
# gpg: using RSA key 0xBDBE7B27C0DE3057
# gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
# gpg: aka "Jeffrey Cody <jeff@codyprime.org>"
# gpg: aka "Jeffrey Cody <codyprime@gmail.com>"
# Primary key fingerprint: 9957 4B4D 3474 90E7 9D98 D624 BDBE 7B27 C0DE 3057
* jtc/tags/block-pull-request:
block/gluster: glfs_lseek() workaround
blockjob: use deferred_to_main_loop to indicate the coroutine has ended
blockjob: reorganize block_job_completed_txn_abort
blockjob: strengthen a bit test-blockjob-txn
blockjob: group BlockJob transaction functions together
blockjob: introduce block_job_cancel_async, check iostatus invariants
blockjob: move iostatus reset inside block_job_user_resume
blockjob: separate monitor and blockjob APIs
blockjob: introduce block_job_pause/resume_all
blockjob: introduce block_job_early_fail
blockjob: remove iostatus_reset callback
blockjob: remove unnecessary check
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/blockjob.h | 16 | ||||
-rw-r--r-- | include/block/blockjob_int.h | 27 |
2 files changed, 15 insertions, 28 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 9e906f7d7e..09c7c694b5 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -235,14 +235,6 @@ void block_job_complete(BlockJob *job, Error **errp); BlockJobInfo *block_job_query(BlockJob *job, Error **errp); /** - * block_job_pause: - * @job: The job to be paused. - * - * Asynchronously pause the specified job. - */ -void block_job_pause(BlockJob *job); - -/** * block_job_user_pause: * @job: The job to be paused. * @@ -260,14 +252,6 @@ void block_job_user_pause(BlockJob *job); bool block_job_user_paused(BlockJob *job); /** - * block_job_resume: - * @job: The job to be resumed. - * - * Resume the specified job. Must be paired with a preceding block_job_pause. - */ -void block_job_resume(BlockJob *job); - -/** * block_job_user_resume: * @job: The job to be resumed. * diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h index 3f86cc5acc..f13ad05c0d 100644 --- a/include/block/blockjob_int.h +++ b/include/block/blockjob_int.h @@ -44,9 +44,6 @@ struct BlockJobDriver { /** Optional callback for job types that support setting a speed limit */ void (*set_speed)(BlockJob *job, int64_t speed, Error **errp); - /** Optional callback for job types that need to forward I/O status reset */ - void (*iostatus_reset)(BlockJob *job); - /** Mandatory: Entrypoint for the Coroutine. */ CoroutineEntry *start; @@ -159,21 +156,26 @@ void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns); void block_job_yield(BlockJob *job); /** - * block_job_ref: - * @bs: The block device. + * block_job_pause_all: + * + * Asynchronously pause all jobs. + */ +void block_job_pause_all(void); + +/** + * block_job_resume_all: * - * Grab a reference to the block job. Should be paired with block_job_unref. + * Resume all block jobs. Must be paired with a preceding block_job_pause_all. */ -void block_job_ref(BlockJob *job); +void block_job_resume_all(void); /** - * block_job_unref: + * block_job_early_fail: * @bs: The block device. * - * Release reference to the block job and release resources if it is the last - * reference. + * The block job could not be started, free it. */ -void block_job_unref(BlockJob *job); +void block_job_early_fail(BlockJob *job); /** * block_job_completed: @@ -239,7 +241,8 @@ typedef void BlockJobDeferToMainLoopFn(BlockJob *job, void *opaque); * @fn: The function to run in the main loop * @opaque: The opaque value that is passed to @fn * - * Execute a given function in the main loop with the BlockDriverState + * This function must be called by the main job coroutine just before it + * returns. @fn is executed in the main loop with the BlockDriverState * AioContext acquired. Block jobs must call bdrv_unref(), bdrv_close(), and * anything that uses bdrv_drain_all() in the main loop. * |