From nobody Mon Feb 9 09:09:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1574243744; cv=none; d=zoho.com; s=zohoarc; b=BRmtkeswo8jjupRBsrnjnTIWgRoU3tISQFZ+hFGgaKc2gTVLFFNQ+YOfpIXYlZM7Bjg9Flq4CbsnDTgoUO/tgOeP5LElklKf3nJ+7ETkMvwUthyCYeSB5WRsJD1X7rFF6RhV5NlscmEyctxWIHwIwnM7GgehvYO64ud3e4U8DIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574243744; h=Content-Type:Content-Transfer-Encoding:Cc: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=TbZ5hIXzIJTSbTWVPQ50xhIpIohZ4uSUbZgZlSsxouI=; b=Lng/s8Zvk+WVRJJhYyhf11kgyCQ/uDLsjKh0/y/QwtFmt8Mh/BD5aR9OXcL3gVL5PeMecl1GSmPgkDlYGERt+Ai/5KXbeAAG4wOiRCWqXuyHiukGLKQz4nSVDWVtvmNl2yP9n+q51NsXAXA38Tn4rEBAsoVNXHE8UxknP8gt2XA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1574243744876913.7906616852355; Wed, 20 Nov 2019 01:55:44 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-157-GT2-x4ubOwWfQ_mUQnce1g-1; Wed, 20 Nov 2019 04:55:40 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF627801FA1; Wed, 20 Nov 2019 09:55:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E96AF6E0; Wed, 20 Nov 2019 09:55:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3F63A4BB65; Wed, 20 Nov 2019 09:55:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAK9tXcI025733 for ; Wed, 20 Nov 2019 04:55:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 80E864DA73; Wed, 20 Nov 2019 09:55:33 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7FEB4D9F7; Wed, 20 Nov 2019 09:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574243742; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=TbZ5hIXzIJTSbTWVPQ50xhIpIohZ4uSUbZgZlSsxouI=; b=KDIBIWw+SiPNz+2RcgofuKS7tD1IN+n+k26NtiXzNx2o5AWRXbBZ1t/uktr9x1RV3mBQY+ ntKGgkriwDSGwQKfy7v5aTdJrhlTL1lj0sykwj6DJ1FoStkxRBkh96Ul1DpLCAArKEH6lm 4h4U9yWQ5eGX+mdTyyoYn5gdlaCFaFw= From: Pavel Mores To: libvir-list@redhat.com Date: Wed, 20 Nov 2019 10:55:24 +0100 Message-Id: <20191120095527.18158-2-pmores@redhat.com> In-Reply-To: <20191120095527.18158-1-pmores@redhat.com> References: <20191120095527.18158-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH 1/4] qemu: block: propagate the delete flag to where it can actually be used X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: GT2-x4ubOwWfQ_mUQnce1g-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Since the blockcommit operation is asynchronous, this has conceptually two parts. First, we have to propagate the flag from qemuDomainBlockCommit() (which was just ignoring it until now) to qemuBlockJobDiskNewCommit(). Then it can be stored in the qemuBlockJobCommitData structure which holds information necessary to finish the job asynchronously. Signed-off-by: Pavel Mores --- src/qemu/qemu_blockjob.c | 4 +++- src/qemu/qemu_blockjob.h | 4 +++- src/qemu/qemu_driver.c | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 5c294f8024..7d94a6ce38 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -250,7 +250,8 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, virDomainDiskDefPtr disk, virStorageSourcePtr topparent, virStorageSourcePtr top, - virStorageSourcePtr base) + virStorageSourcePtr base, + bool delete_imgs) { qemuDomainObjPrivatePtr priv =3D vm->privateData; g_autoptr(qemuBlockJobData) job =3D NULL; @@ -273,6 +274,7 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, job->data.commit.topparent =3D topparent; job->data.commit.top =3D top; job->data.commit.base =3D base; + job->data.commit.deleteCommittedImages =3D delete_imgs; =20 if (qemuBlockJobRegister(job, vm, disk, true) < 0) return NULL; diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index d8da918f2f..d77f1dcdb3 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -85,6 +85,7 @@ struct _qemuBlockJobCommitData { virStorageSourcePtr topparent; virStorageSourcePtr top; virStorageSourcePtr base; + bool deleteCommittedImages; }; =20 =20 @@ -165,7 +166,8 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, virDomainDiskDefPtr disk, virStorageSourcePtr topparent, virStorageSourcePtr top, - virStorageSourcePtr base); + virStorageSourcePtr base, + bool delete_imgs); =20 qemuBlockJobDataPtr qemuBlockJobNewCreate(virDomainObjPtr vm, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dc14ec86a3..75458f5c8a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18496,10 +18496,10 @@ qemuDomainBlockCommit(virDomainPtr dom, bool persistjob =3D false; bool blockdev =3D false; =20 - /* XXX Add support for COMMIT_DELETE */ virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW | VIR_DOMAIN_BLOCK_COMMIT_ACTIVE | VIR_DOMAIN_BLOCK_COMMIT_RELATIVE | + VIR_DOMAIN_BLOCK_COMMIT_DELETE | VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES, -1); =20 if (!(vm =3D qemuDomainObjFromDomain(dom))) @@ -18638,7 +18638,8 @@ qemuDomainBlockCommit(virDomainPtr dom, goto endjob; =20 if (!(job =3D qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSourc= e, - baseSource))) + baseSource, + flags & VIR_DOMAIN_BLOCK_COMMIT_= DELETE))) goto endjob; =20 disk->mirrorState =3D VIR_DOMAIN_DISK_MIRROR_STATE_NONE; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list