From nobody Mon Apr 29 20:26:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510687090742538.631895828815; Tue, 14 Nov 2017 11:18:10 -0800 (PST) Received: from localhost ([::1]:33247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEgie-0008U1-DJ for importer@patchew.org; Tue, 14 Nov 2017 14:18:00 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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..e43a7eaeb22b92c613edcb4219e= d4f0e928577b6 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_COMPL= ETED +# 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 en= ded +# 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 stream= ing # operation happens to complete just as it is being cancelled. A new stre= aming # operation can be started at a later time to finish copying all data from= the --=20 2.9.5