diff options
author | John Snow <jsnow@redhat.com> | 2018-03-10 03:27:42 -0500 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-03-19 12:01:24 +0100 |
commit | 5f241594c40875af526a53c7a8c6466e487f4e5e (patch) | |
tree | 989aeb15ff86747b8ccd3fa5ad4f6c96d7bd7c95 /include | |
parent | e8af5686ff6f63a81120f6b8e291f220475796ce (diff) | |
download | qemu-5f241594c40875af526a53c7a8c6466e487f4e5e.zip qemu-5f241594c40875af526a53c7a8c6466e487f4e5e.tar.gz qemu-5f241594c40875af526a53c7a8c6466e487f4e5e.tar.bz2 |
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')
-rw-r--r-- | include/block/blockjob.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index c535829..7c8d51e 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; |