mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
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>
This commit is contained in:
parent
e8af5686ff
commit
5f241594c4
3 changed files with 78 additions and 25 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue