From nobody Tue Feb 10 19:14:26 2026 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 1507000702322646.7524921014752; Mon, 2 Oct 2017 20:18:22 -0700 (PDT) Received: from localhost ([::1]:55967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzDir-0008Ec-Td for importer@patchew.org; Mon, 02 Oct 2017 23:18:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzDgm-00070e-BE for qemu-devel@nongnu.org; Mon, 02 Oct 2017 23:16:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzDgl-0005sY-5E for qemu-devel@nongnu.org; Mon, 02 Oct 2017 23:16:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42282) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dzDgh-0005nf-Qg; Mon, 02 Oct 2017 23:16:04 -0400 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 EB51746213; Tue, 3 Oct 2017 03:16:02 +0000 (UTC) Received: from probe.redhat.com (ovpn-120-249.rdu2.redhat.com [10.10.120.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3624A6047F; Tue, 3 Oct 2017 03:16:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EB51746213 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jsnow@redhat.com From: John Snow To: qemu-block@nongnu.org Date: Mon, 2 Oct 2017 23:15:56 -0400 Message-Id: <20171003031556.15173-4-jsnow@redhat.com> In-Reply-To: <20171003031556.15173-1-jsnow@redhat.com> References: <20171003031556.15173-1-jsnow@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.29]); Tue, 03 Oct 2017 03:16:03 +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 3/3] blockjob: expose manual-cull property 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: kwolf@redhat.com, John Snow , pkrempa@redhat.com, jtc@redhat.com, qemu-devel@nongnu.org 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" For drive-backup and blockdev-backup, expose the manual-cull property, having it default to false. There are no universal creation parameters, so it must be added to each job type that it makes sense for individually. Signed-off-by: John Snow --- blockdev.c | 10 ++++++++-- qapi/block-core.json | 21 ++++++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/blockdev.c b/blockdev.c index ee07bca..ba2ebfb 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3198,6 +3198,9 @@ static BlockJob *do_drive_backup(DriveBackup *backup,= BlockJobTxn *txn, if (!backup->has_job_id) { backup->job_id =3D NULL; } + if (!backup->has_manual_cull) { + backup->manual_cull =3D false; + } if (!backup->has_compress) { backup->compress =3D false; } @@ -3290,7 +3293,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup,= BlockJobTxn *txn, } } =20 - job =3D backup_job_create(backup->job_id, false, bs, target_bs, + job =3D backup_job_create(backup->job_id, backup->manual_cull, bs, tar= get_bs, backup->speed, backup->sync, bmap, backup->com= press, backup->on_source_error, backup->on_target_err= or, BLOCK_JOB_DEFAULT, NULL, NULL, txn, &local_err= ); @@ -3341,6 +3344,9 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, = BlockJobTxn *txn, if (!backup->has_job_id) { backup->job_id =3D NULL; } + if (!backup->has_manual_cull) { + backup->manual_cull =3D false; + } if (!backup->has_compress) { backup->compress =3D false; } @@ -3369,7 +3375,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, = BlockJobTxn *txn, goto out; } } - job =3D backup_job_create(backup->job_id, false, bs, target_bs, + job =3D backup_job_create(backup->job_id, backup->manual_cull, bs, tar= get_bs, backup->speed, backup->sync, NULL, backup->com= press, backup->on_source_error, backup->on_target_err= or, BLOCK_JOB_DEFAULT, NULL, NULL, txn, &local_err= ); diff --git a/qapi/block-core.json b/qapi/block-core.json index de322d1..c646743 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1104,6 +1104,11 @@ # @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # +# @manual-cull: Whether or not the job created by this command needs to be +# cleaned up manually via block-job-cull or not. The default= is +# false. When true, the job will remain in a "completed" sta= te +# until culled manually with block-job-cull. (Since 2.11) +# # @device: the device name or node-name of a root node which should be cop= ied. # # @target: the target of the new image. If the file exists, or if it @@ -1144,9 +1149,10 @@ # Since: 1.6 ## { 'struct': 'DriveBackup', - 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', - '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImage= Mode', - '*speed': 'int', '*bitmap': 'str', '*compress': 'bool', + 'data': { '*job-id': 'str', '*manual-cull': 'bool', 'device': 'str', + 'target': 'str', '*format': 'str', 'sync': 'MirrorSyncMode', + '*mode': 'NewImageMode', '*speed': 'int', '*bitmap': 'str', + '*compress': 'bool', '*on-source-error': 'BlockdevOnError', '*on-target-error': 'BlockdevOnError' } } =20 @@ -1156,6 +1162,11 @@ # @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # +# @manual-cull: Whether or not the job created by this command needs to be +# cleaned up manually via block-job-cull or not. The default= is +# false. When true, the job will remain in a "completed" sta= te +# until culled manually with block-job-cull. (Since 2.11) +# # @device: the device name or node-name of a root node which should be cop= ied. # # @target: the device name or node-name of the backup target node. @@ -1185,8 +1196,8 @@ # Since: 2.3 ## { 'struct': 'BlockdevBackup', - 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', - 'sync': 'MirrorSyncMode', + 'data': { '*job-id': 'str', '*manual-cull': 'bool', 'device': 'str', + 'target': 'str', 'sync': 'MirrorSyncMode', '*speed': 'int', '*compress': 'bool', '*on-source-error': 'BlockdevOnError', --=20 2.9.5