From patchwork Fri Sep 28 15:22:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [06/19] qmp: add 'busy' member to BlockJobInfo Date: Fri, 28 Sep 2012 05:22:49 -0000 From: Paolo Bonzini X-Patchwork-Id: 187826 Message-Id: <1348845782-15073-7-git-send-email-pbonzini@redhat.com> To: qemu-devel@nongnu.org Cc: kwolf@redhat.com Because pausing a job is asynchronous, we need to know whether it has completed. This is described by the "busy" field of BlockJob; copy it to BlockJobInfo. Signed-off-by: Paolo Bonzini --- blockjob.c | 1 + qapi-schema.json | 5 ++++- 2 file modificati, 5 inserzioni(+). 1 rimozione(-) diff --git a/blockjob.c b/blockjob.c index dea63f8..64c9d2d 100644 --- a/blockjob.c +++ b/blockjob.c @@ -168,6 +168,7 @@ BlockJobInfo *block_job_query(BlockJob *job) info->type = g_strdup(job->job_type->job_type); info->device = g_strdup(bdrv_get_device_name(job->bs)); info->len = job->len; + info->busy = job->busy; info->offset = job->offset; info->speed = job->speed; return info; diff --git a/qapi-schema.json b/qapi-schema.json index 14e4419..add93f9 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1098,6 +1098,9 @@ # # @len: the maximum progress value # +# @busy: false if the job is known to be in a quiescent state, with +# no pending I/O. Since 1.3. +# # @offset: the current progress value # # @speed: the rate limit, bytes per second @@ -1106,7 +1109,7 @@ ## { 'type': 'BlockJobInfo', 'data': {'type': 'str', 'device': 'str', 'len': 'int', - 'offset': 'int', 'speed': 'int'} } + 'offset': 'int', 'busy': 'bool', 'speed': 'int'} } ## # @query-block-jobs: