mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
blockjobs: add NULL state
Add a new state that specifically demarcates when we begin to permanently demolish a job after it has performed all work. This makes the transition explicit in the STM table and highlights conditions under which a job may be demolished. Alongside this state, add a new helper command "block_job_decommission", which transitions to the NULL state and puts down our implicit reference. This separates instances in the code for "block_job_unref" which merely undo a matching "block_job_ref" with instances intended to initiate the full destruction of the object. This decommission action also sets a number of fields to make sure that block internals or external users that are holding a reference to a job to see when it "finishes" are convinced that the job object is "done." This is necessary, for instance, to do a block_job_cancel_sync on a created object which will not make any progress. Now, all jobs must go through block_job_decommission prior to being freed, giving us start-to-finish state machine coverage for jobs. Transitions: Created -> Null: Early failure event before the job is started Concluded -> Null: Standard transition. Verbs: None. This should not ever be visible to the monitor. +---------+ |UNDEFINED| +--+------+ | +--v----+ +---------+CREATED+------------------+ | +--+----+ | | | | | +--v----+ +------+ | +---------+RUNNING<----->PAUSED| | | +--+-+--+ +------+ | | | | | | | +------------------+ | | | | | | +--v--+ +-------+ | | +---------+READY<------->STANDBY| | | | +--+--+ +-------+ | | | | | | +--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
e0cf03647a
commit
3925cd3bc7
2 changed files with 36 additions and 19 deletions
|
@ -1006,11 +1006,14 @@
|
|||
# @concluded: The job has finished all work. If manual was set to true, the job
|
||||
# will remain in the query list until it is dismissed.
|
||||
#
|
||||
# @null: The job is in the process of being dismantled. This state should not
|
||||
# ever be visible externally.
|
||||
#
|
||||
# Since: 2.12
|
||||
##
|
||||
{ 'enum': 'BlockJobStatus',
|
||||
'data': ['undefined', 'created', 'running', 'paused', 'ready', 'standby',
|
||||
'aborting', 'concluded' ] }
|
||||
'aborting', 'concluded', 'null' ] }
|
||||
|
||||
##
|
||||
# @BlockJobInfo:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue