From patchwork Fri Sep 28 17:57:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 187853 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B20362C00C4 for ; Sat, 29 Sep 2012 03:59:43 +1000 (EST) Received: from localhost ([::1]:40830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THeqj-0006Vl-U2 for incoming@patchwork.ozlabs.org; Fri, 28 Sep 2012 13:59:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THeos-0003jv-Qt for qemu-devel@nongnu.org; Fri, 28 Sep 2012 13:57:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THeoq-0007kp-VI for qemu-devel@nongnu.org; Fri, 28 Sep 2012 13:57:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THeoq-0007kU-NJ for qemu-devel@nongnu.org; Fri, 28 Sep 2012 13:57:44 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8SHvgIU025800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Sep 2012 13:57:42 -0400 Received: from dhcp-5-188.str.redhat.com (vpn1-7-84.ams2.redhat.com [10.36.7.84]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8SHvF3L020617; Fri, 28 Sep 2012 13:57:41 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Fri, 28 Sep 2012 19:57:01 +0200 Message-Id: <1348855033-17174-19-git-send-email-kwolf@redhat.com> In-Reply-To: <1348855033-17174-1-git-send-email-kwolf@redhat.com> References: <1348855033-17174-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 18/30] qmp: add 'busy' member to BlockJobInfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Paolo Bonzini 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 Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- blockjob.c | 1 + qapi-schema.json | 5 ++++- 2 files changed, 5 insertions(+), 1 deletions(-) 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 5816545..6fc6eda 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: