From 5f241594c40875af526a53c7a8c6466e487f4e5e Mon Sep 17 00:00:00 2001 From: John Snow Date: Sat, 10 Mar 2018 03:27:42 -0500 Subject: 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 Signed-off-by: Kevin Wolf --- include/block/blockjob.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/block/blockjob.h') 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; -- cgit v1.2.3