summaryrefslogtreecommitdiffstats
path: root/include/block/blockjob.h
diff options
context:
space:
mode:
authorJohn Snow2018-03-10 09:27:42 +0100
committerKevin Wolf2018-03-19 12:01:24 +0100
commit5f241594c40875af526a53c7a8c6466e487f4e5e (patch)
tree989aeb15ff86747b8ccd3fa5ad4f6c96d7bd7c95 /include/block/blockjob.h
parentblockjobs: add waiting status (diff)
downloadqemu-5f241594c40875af526a53c7a8c6466e487f4e5e.tar.gz
qemu-5f241594c40875af526a53c7a8c6466e487f4e5e.tar.xz
qemu-5f241594c40875af526a53c7a8c6466e487f4e5e.zip
blockjobs: add PENDING status and event
For jobs utilizing the new manual workflow, we intend to prohibit them from modifying the block graph until the management layer provides an explicit ACK via block-job-finalize to move the process forward. To distinguish this runstate from "ready" or "waiting," we add a new "pending" event and status. For now, the transition from PENDING to CONCLUDED/ABORTING is automatic, but a future commit will add the explicit block-job-finalize step. Transitions: Waiting -> Pending: Normal transition. Pending -> Concluded: Normal transition. Pending -> Aborting: Late transactional failures and cancellations. Removed Transitions: Waiting -> Concluded: Jobs must go to PENDING first. Verbs: Cancel: Can be applied to a pending job. +---------+ |UNDEFINED| +--+------+ | +--v----+ +---------+CREATED+-----------------+ | +--+----+ | | | | | +--+----+ +------+ | +---------+RUNNING<----->PAUSED| | | +--+-+--+ +------+ | | | | | | | +------------------+ | | | | | | +--v--+ +-------+ | | +---------+READY<------->STANDBY| | | | +--+--+ +-------+ | | | | | | | +--v----+ | | +---------+WAITING<---------------+ | | +--+----+ | | | | | +--v----+ | +---------+PENDING| | | +--+----+ | | | | +--v-----+ +--v------+ | |ABORTING+--->CONCLUDED| | +--------+ +--+------+ | | | +--v-+ | |NULL<--------------------+ +----+ Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/blockjob.h')
-rw-r--r--include/block/blockjob.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index c535829b46..7c8d51effa 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -142,6 +142,9 @@ typedef struct BlockJob {
/** Current state; See @BlockJobStatus for details. */
BlockJobStatus status;
+ /** True if this job should automatically finalize itself */
+ bool auto_finalize;
+
/** True if this job should automatically dismiss itself */
bool auto_dismiss;
@@ -154,6 +157,8 @@ typedef enum BlockJobCreateFlags {
BLOCK_JOB_DEFAULT = 0x00,
/* BlockJob is not QMP-created and should not send QMP events */
BLOCK_JOB_INTERNAL = 0x01,
+ /* BlockJob requires manual finalize step */
+ BLOCK_JOB_MANUAL_FINALIZE = 0x02,
/* BlockJob requires manual dismiss step */
BLOCK_JOB_MANUAL_DISMISS = 0x04,
} BlockJobCreateFlags;