From patchwork Tue Nov 14 19:16:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kashyap Chamarthy X-Patchwork-Id: 837999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yby213N6hz9s82 for ; Wed, 15 Nov 2017 06:17:29 +1100 (AEDT) Received: from localhost ([::1]:33245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEgi7-00088V-9z for incoming@patchwork.ozlabs.org; Tue, 14 Nov 2017 14:17:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEghB-0007hw-I9 for qemu-devel@nongnu.org; Tue, 14 Nov 2017 14:16:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEghA-0001Ov-JM for qemu-devel@nongnu.org; Tue, 14 Nov 2017 14:16:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13435) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eEgh4-0001Jz-8p; Tue, 14 Nov 2017 14:16:22 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 871AA5F7AD; Tue, 14 Nov 2017 19:16:20 +0000 (UTC) Received: from eukaryote.localdomain (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E404605B2; Tue, 14 Nov 2017 19:16:18 +0000 (UTC) From: Kashyap Chamarthy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Tue, 14 Nov 2017 20:16:04 +0100 Message-Id: <20171114191605.22349-1-kchamart@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 14 Nov 2017 19:16:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qapi: block-core: Clarify events emitted by 'block-job-cancel' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kashyap Chamarthy , armbru@redhat.com, mreitz@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" When you cancel an in-progress live block operation with QMP `block-job-cancel`, it emits the event: BLOCK_JOB_CANCELLED. However, when `block-job-cancel` is issued after `drive-mirror` has indicated (by emitting the event BLOCK_JOB_READY) that the source and destination remain synchronized: [...] # Snip `drive-mirror` invocation & outputs { "execute":"block-job-cancel", "arguments":{ "device":"virtio0" } } {"return": {}} It (`block-job-cancel`) will counterintuitively emit the event 'BLOCK_JOB_COMPLETED': { "timestamp":{ "seconds":1510678024, "microseconds":526240 }, "event":"BLOCK_JOB_COMPLETED", "data":{ "device":"virtio0", "len":41126400, "offset":41126400, "speed":0, "type":"mirror" } } But this is expected behaviour, where the _COMPLETED event indicates that synchronization has successfully ended (and the destination has a point-in-time copy, which is at the time of cancel). So add a small note to this effect. (Thanks: Max Reitz for reminding me of this on IRC.) --- qapi/block-core.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index ab96e348e6317bb42769ae20f4a4519bac02e93a..e43a7eaeb22b92c613edcb4219ed4f0e928577b6 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2065,6 +2065,14 @@ # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when # enumerated using query-block-jobs. # +# Note: The 'block-job-cancel' command will emit the event BLOCK_JOB_COMPLETED +# if you issue it ('block-job-cancel') after 'drive-mirror' has +# indicated (by emitting the event BLOCK_JOB_READY) that the source and +# destination remain synchronized. In this case, the BLOCK_JOB_COMPLETED event +# indicates that synchronization (from `drive-mirror`) has successfully ended +# and the destination now has a point-in-time copy, which is at the time of +# cancel. +# # For streaming, the image file retains its backing file unless the streaming # operation happens to complete just as it is being cancelled. A new streaming # operation can be started at a later time to finish copying all data from the