summaryrefslogtreecommitdiffstats
path: root/qapi
diff options
context:
space:
mode:
authorKevin Wolf2018-05-04 16:25:43 +0200
committerKevin Wolf2018-05-23 14:30:51 +0200
commit456273b02474780537e2bb52a72213f63bb5227a (patch)
tree0ab2748bc922e4e6c3471f01c6277dc703d0da97 /qapi
parentjob: Add lifecycle QMP commands (diff)
downloadqemu-456273b02474780537e2bb52a72213f63bb5227a.tar.gz
qemu-456273b02474780537e2bb52a72213f63bb5227a.tar.xz
qemu-456273b02474780537e2bb52a72213f63bb5227a.zip
job: Add query-jobs QMP command
This adds a minimal query-jobs implementation that shouldn't pose many design questions. It can later be extended to expose more information, and especially job-specific information. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/job.json46
1 files changed, 46 insertions, 0 deletions
diff --git a/qapi/job.json b/qapi/job.json
index b84dc6c820..970124de76 100644
--- a/qapi/job.json
+++ b/qapi/job.json
@@ -205,3 +205,49 @@
# Since: 2.13
##
{ 'command': 'job-finalize', 'data': { 'id': 'str' } }
+
+##
+# @JobInfo:
+#
+# Information about a job.
+#
+# @id: The job identifier
+#
+# @type: The kind of job that is being performed
+#
+# @status: Current job state/status
+#
+# @current-progress: Progress made until now. The unit is arbitrary and the
+# value can only meaningfully be used for the ratio of
+# @current-progress to @total-progress. The value is
+# monotonically increasing.
+#
+# @total-progress: Estimated @current-progress value at the completion of
+# the job. This value can arbitrarily change while the
+# job is running, in both directions.
+#
+# @error: If this field is present, the job failed; if it is
+# still missing in the CONCLUDED state, this indicates
+# successful completion.
+#
+# The value is a human-readable error message to describe
+# the reason for the job failure. It should not be parsed
+# by applications.
+#
+# Since: 2.13
+##
+{ 'struct': 'JobInfo',
+ 'data': { 'id': 'str', 'type': 'JobType', 'status': 'JobStatus',
+ 'current-progress': 'int', 'total-progress': 'int',
+ '*error': 'str' } }
+
+##
+# @query-jobs:
+#
+# Return information about jobs.
+#
+# Returns: a list with a @JobInfo for each active job
+#
+# Since: 2.13
+##
+{ 'command': 'query-jobs', 'returns': ['JobInfo'] }