aboutsummaryrefslogtreecommitdiff
path: root/include/block/blockjob_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/block/blockjob_int.h')
-rw-r--r--include/block/blockjob_int.h27
1 files changed, 15 insertions, 12 deletions
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.
*