From nobody Thu May 2 14:57:55 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 1510737077159167.4869298704033; Wed, 15 Nov 2017 01:11:17 -0800 (PST) Received: from localhost ([::1]:35198 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEtj0-0003Jd-Av for importer@patchew.org; Wed, 15 Nov 2017 04:11:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEthp-0002fl-Vk for qemu-devel@nongnu.org; Wed, 15 Nov 2017 04:10:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEthp-00045g-2f for qemu-devel@nongnu.org; Wed, 15 Nov 2017 04:10:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40992) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eEthj-00040l-OZ; Wed, 15 Nov 2017 04:09:55 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA7055F7BF; Wed, 15 Nov 2017 09:09:54 +0000 (UTC) Received: from eukaryote.localdomain (ovpn-117-94.ams2.redhat.com [10.36.117.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3904993AC; Wed, 15 Nov 2017 09:09:52 +0000 (UTC) From: Kashyap Chamarthy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 15 Nov 2017 10:09:47 +0100 Message-Id: <20171115090947.29883-1-kchamart@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 15 Nov 2017 09:09:54 +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 v2] 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.) Signed-off-by: Kashyap Chamarthy --- Changes in v2: - "Note:" seems to be a special construct in Patchew, my usage caused a build failure. So do: s/Note:/Note that/ - Add the missing 'Signed-off-by' --- qapi/block-core.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index ab96e348e6317bb42769ae20f4a4519bac02e93a..4ecfd1fbc5bc231c69da15d489c= 44e3e8b0706a5 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 that the 'block-job-cancel' command will emit the event +# BLOCK_JOB_COMPLETED if you issue it ('block-job-cancel') after 'drive-mi= rror' +# 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 successfu= lly +# 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 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