11 # Type of a background job.
13 # @commit: block commit job type, see "block-commit"
15 # @stream: block stream job type, see "block-stream"
17 # @mirror: drive mirror job type, see "drive-mirror"
19 # @backup: drive backup job type, see "drive-backup"
21 # @create: image creation job type, see "blockdev-create" (since 3.0)
23 # @amend: image options amend job type, see "x-blockdev-amend" (since 5.1)
25 # @snapshot-load: snapshot load job type, see "snapshot-load" (since 6.0)
27 # @snapshot-save: snapshot save job type, see "snapshot-save" (since 6.0)
29 # @snapshot-delete: snapshot delete job type, see "snapshot-delete" (since 6.0)
34 'data': ['commit', 'stream', 'mirror', 'backup', 'create', 'amend',
35 'snapshot-load', 'snapshot-save', 'snapshot-delete'] }
40 # Indicates the present state of a given job in its lifetime.
42 # @undefined: Erroneous, default state. Should not ever be visible.
44 # @created: The job has been created, but not yet started.
46 # @running: The job is currently running.
48 # @paused: The job is running, but paused. The pause may be requested by
49 # either the QMP user or by internal processes.
51 # @ready: The job is running, but is ready for the user to signal completion.
52 # This is used for long-running jobs like mirror that are designed to
55 # @standby: The job is ready, but paused. This is nearly identical to @paused.
56 # The job may return to @ready or otherwise be canceled.
58 # @waiting: The job is waiting for other jobs in the transaction to converge
59 # to the waiting state. This status will likely not be visible for
60 # the last job in a transaction.
62 # @pending: The job has finished its work, but has finalization steps that it
63 # needs to make prior to completing. These changes will require
64 # manual intervention via @job-finalize if auto-finalize was set to
65 # false. These pending changes may still fail.
67 # @aborting: The job is in the process of being aborted, and will finish with
68 # an error. The job will afterwards report that it is @concluded.
69 # This status may not be visible to the management process.
71 # @concluded: The job has finished all work. If auto-dismiss was set to false,
72 # the job will remain in the query list until it is dismissed via
75 # @null: The job is in the process of being dismantled. This state should not
76 # ever be visible externally.
80 { 'enum': 'JobStatus',
81 'data': ['undefined', 'created', 'running', 'paused', 'ready', 'standby',
82 'waiting', 'pending', 'aborting', 'concluded', 'null' ] }
87 # Represents command verbs that can be applied to a job.
89 # @cancel: see @job-cancel
91 # @pause: see @job-pause
93 # @resume: see @job-resume
95 # @set-speed: see @block-job-set-speed
97 # @complete: see @job-complete
99 # @dismiss: see @job-dismiss
101 # @finalize: see @job-finalize
106 'data': ['cancel', 'pause', 'resume', 'set-speed', 'complete', 'dismiss',
110 # @JOB_STATUS_CHANGE:
112 # Emitted when a job transitions to a different status.
114 # @id: The job identifier
115 # @status: The new job status
119 { 'event': 'JOB_STATUS_CHANGE',
120 'data': { 'id': 'str',
121 'status': 'JobStatus' } }
126 # Pause an active job.
128 # This command returns immediately after marking the active job for pausing.
129 # Pausing an already paused job is an error.
131 # The job will pause as soon as possible, which means transitioning into the
132 # PAUSED state if it was RUNNING, or into STANDBY if it was READY. The
133 # corresponding JOB_STATUS_CHANGE event will be emitted.
135 # Cancelling a paused job automatically resumes it.
137 # @id: The job identifier.
141 { 'command': 'job-pause', 'data': { 'id': 'str' } }
146 # Resume a paused job.
148 # This command returns immediately after resuming a paused job. Resuming an
149 # already running job is an error.
151 # @id: The job identifier.
155 { 'command': 'job-resume', 'data': { 'id': 'str' } }
160 # Instruct an active background job to cancel at the next opportunity.
161 # This command returns immediately after marking the active job for
164 # The job will cancel as soon as possible and then emit a JOB_STATUS_CHANGE
165 # event. Usually, the status will change to ABORTING, but it is possible that
166 # a job successfully completes (e.g. because it was almost done and there was
167 # no opportunity to cancel earlier than completing the job) and transitions to
170 # @id: The job identifier.
174 { 'command': 'job-cancel', 'data': { 'id': 'str' } }
179 # Manually trigger completion of an active job in the READY state.
181 # @id: The job identifier.
185 { 'command': 'job-complete', 'data': { 'id': 'str' } }
190 # Deletes a job that is in the CONCLUDED state. This command only needs to be
191 # run explicitly for jobs that don't have automatic dismiss enabled.
193 # This command will refuse to operate on any job that has not yet reached its
194 # terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of JOB_READY
195 # event, job-cancel or job-complete will still need to be used as appropriate.
197 # @id: The job identifier.
201 { 'command': 'job-dismiss', 'data': { 'id': 'str' } }
206 # Instructs all jobs in a transaction (or a single job if it is not part of any
207 # transaction) to finalize any graph changes and do any necessary cleanup. This
208 # command requires that all involved jobs are in the PENDING state.
210 # For jobs in a transaction, instructing one job to finalize will force
211 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
212 # a single member job to finalize.
214 # @id: The identifier of any job in the transaction, or of a job that is not
215 # part of any transaction.
219 { 'command': 'job-finalize', 'data': { 'id': 'str' } }
224 # Information about a job.
226 # @id: The job identifier
228 # @type: The kind of job that is being performed
230 # @status: Current job state/status
232 # @current-progress: Progress made until now. The unit is arbitrary and the
233 # value can only meaningfully be used for the ratio of
234 # @current-progress to @total-progress. The value is
235 # monotonically increasing.
237 # @total-progress: Estimated @current-progress value at the completion of
238 # the job. This value can arbitrarily change while the
239 # job is running, in both directions.
241 # @error: If this field is present, the job failed; if it is
242 # still missing in the CONCLUDED state, this indicates
243 # successful completion.
245 # The value is a human-readable error message to describe
246 # the reason for the job failure. It should not be parsed
251 { 'struct': 'JobInfo',
252 'data': { 'id': 'str', 'type': 'JobType', 'status': 'JobStatus',
253 'current-progress': 'int', 'total-progress': 'int',
259 # Return information about jobs.
261 # Returns: a list with a @JobInfo for each active job
265 { 'command': 'query-jobs', 'returns': ['JobInfo'] }