From nobody Sun Feb 8 19:03:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672919293; cv=none; d=zohomail.com; s=zohoarc; b=m0+wzUWBmkdq62Ec7LBkwI1bs/WSo3W/0Vv6iLeYSmcfktwh6PbbOtWsD7ZF+njH13bqpyjKj2nD8PQkyuxFUV9EHMaxP5B5NHn+Euvk4SyfH6LMZPIAvQ78J61bebK8ZkgeLpayyVHxYPuytDxGefRal0U3hnSdetzpaVo4Jjo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672919293; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LaYSmvNSZEkYv3EplW3ksxK2d76dOKX4LXQmTFuF7Zk=; b=llwiDi1FSh8qQFu2hfbvUY4dKR7sukdqjKvqvJFFNKnMkXJJa3XYxJwwnYYvMQvE3cSY4FaDXhdzdUplXCFwoSwtRpSRUPeAyz/mTWPoelTepBoeY4A36bodge5cN/X66C34RokG/a0X8Yhxytuujo7vXlvjQmTQLbpWeT+qCVo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1672919293585525.0917941859448; Thu, 5 Jan 2023 03:48:13 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-GYZRH6dmMTWkU4Xfz48Xfw-1; Thu, 05 Jan 2023 06:47:31 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 346E38030DA; Thu, 5 Jan 2023 11:47:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C0882026D2B; Thu, 5 Jan 2023 11:47:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CA8381946A70; Thu, 5 Jan 2023 11:47:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EF8191946586 for ; Thu, 5 Jan 2023 11:47:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E340A40104E; Thu, 5 Jan 2023 11:47:21 +0000 (UTC) Received: from localhost.localdomain (ovpn-194-38.brq.redhat.com [10.40.194.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 814B1492D8B for ; Thu, 5 Jan 2023 11:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672919292; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=LaYSmvNSZEkYv3EplW3ksxK2d76dOKX4LXQmTFuF7Zk=; b=OFNVDj7GVgDq+dKto2C7Cv3R2bLAVkRY2Sjn4pCjFV5swV5aeI51pZ9ufXBxAozU86/zX/ Udt/1pNS0N3+KblIhMBbsfOl4WRxWneg9jTMjBmYFiXZ1wruO2BHhoJt26nel6YDRDsAx1 jD8KU51tbp9roPBes6CRP/boU1I1KuM= X-MC-Unique: GYZRH6dmMTWkU4Xfz48Xfw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 08/31] qemu_block: allow configuring autofinalize for block commit Date: Thu, 5 Jan 2023 12:46:44 +0100 Message-Id: <022834b2b6f3d988b29081e25167186eddd4cd8d.1672918676.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672919295148100001 Content-Type: text/plain; charset="utf-8"; x-default="true" External snapshots will use this to synchronize qemu block jobs. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_block.c | 9 ++++++++- src/qemu/qemu_block.h | 1 + src/qemu/qemu_driver.c | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 99409a969b..da3a1e8557 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -3207,11 +3207,17 @@ qemuBlockExportAddNBD(virDomainObj *vm, * @top_parent: disk source that has @topSource as backing disk * @bandwidth: bandwidth limit, flags determine the unit * @asyncJob: qemu async job type + * @autofinalize: virTristateBool controlling qemu block job finalization * @flags: bitwise-OR of virDomainBlockCommitFlags * * Starts a block commit job for @disk. If @asyncJob is different then * VIR_ASYNC_JOB_NONE the job will be started as synchronous. * + * The @autofinalize argument controls if the qemu block job will be autom= atically + * finalized. This is used when deleting external snapshots where we need = to + * disable automatic finalization for some use-case. The default value pas= sed + * to this argument should be VIR_TRISTATE_BOOL_YES. + * * Returns -1 on error, 0 on success. */ int @@ -3222,6 +3228,7 @@ qemuBlockCommit(virDomainObj *vm, virStorageSource *top_parent, unsigned long bandwidth, virDomainAsyncJob asyncJob, + virTristateBool autofinalize, unsigned int flags) { qemuDomainObjPrivate *priv =3D vm->privateData; @@ -3365,7 +3372,7 @@ qemuBlockCommit(virDomainObj *vm, topSource->nodeformat, baseSource->nodeformat, backingPath, bandwidth, - VIR_TRISTATE_BOOL_YES); + autofinalize); =20 qemuDomainObjExitMonitor(vm); =20 diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 3f2082f102..7b6aec2a7d 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -285,6 +285,7 @@ qemuBlockCommit(virDomainObj *vm, virStorageSource *top_parent, unsigned long bandwidth, virDomainAsyncJob asyncJob, + virTristateBool autofinalize, unsigned int flags); =20 int diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index acd67b1f5a..12fca22616 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15031,7 +15031,8 @@ qemuDomainBlockCommit(virDomainPtr dom, goto endjob; =20 ret =3D qemuBlockCommit(vm, disk, baseSource, topSource, top_parent, - bandwidth, VIR_ASYNC_JOB_NONE, flags); + bandwidth, VIR_ASYNC_JOB_NONE, VIR_TRISTATE_BOOL= _YES, + flags); =20 endjob: virDomainObjEndJob(vm); --=20 2.39.0