From nobody Mon Feb 9 16:51:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1575995204; cv=none; d=zohomail.com; s=zohoarc; b=PoJs2Mcebq7fnboslDo+xvCRHwXbYA3qMR4QTo6BohmMe3EFGf6mpGfAVjH8eSKfhO6Al/2z3jmcBtIlXDC+5h1Gou8T7axg2HO7KQe/b/LYbR4rTpFLV1PDRFm+bP2r7yGHUVm3plBk+aNn4AVQjXVY2Ev2ZzTcnmlRdqxyMcI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575995204; 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=IhhJXivSQwfOLKbVxXPqJ6V89pU99isHS1KIB6/VpXQ=; b=AVif+5ej8Jin37d84EBswe3x61RLJJqjNT/+B904QO6wmss028JU2Bq8mUzNg9PuiMBjXe35jUF642lm0N7XvTU86dChrhP5YdzERHkqLTzwbX342pxpw17ymtU0+iiy+YILXr/0WBi0uZpvz0y5l6IjNpR9DkHZD5Wzwsb2X6o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1575995204902205.2483948391299; Tue, 10 Dec 2019 08:26: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-412-D6M6Nt7QN7is47zpY8f4lg-1; Tue, 10 Dec 2019 11:26:40 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D154800C75; Tue, 10 Dec 2019 16:26:35 +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 39D546FF0F; Tue, 10 Dec 2019 16:26:35 +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 CD59783568; Tue, 10 Dec 2019 16:26:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBAGPoF6006234 for ; Tue, 10 Dec 2019 11:25:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2FF3C19486; Tue, 10 Dec 2019 16:25:50 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83AD819C6A; Tue, 10 Dec 2019 16:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575995203; 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=IhhJXivSQwfOLKbVxXPqJ6V89pU99isHS1KIB6/VpXQ=; b=OIpx4bdbNij1TF8p09SBakiBj5sGYsE7Sgz6TMPtZ6H+w6PBE3XUmf4qcVILM9Tc5uCq05 KMBaV/ldR+SXsB9hdmoe0/1jP4Q0Eb8x3I8lefGt7tNULHTfkjis/L0m8aww9KC8CV9vPG a2c8kiDFgxTZ3fPJdbqTghSdzKBGJMs= From: Pavel Mores To: libvir-list@redhat.com Date: Tue, 10 Dec 2019 17:25:41 +0100 Message-Id: <20191210162541.15432-5-pmores@redhat.com> In-Reply-To: <20191210162541.15432-1-pmores@redhat.com> References: <20191210162541.15432-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH v4 4/4] qemu: block: enable the snapshot image deletion feature 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.79 on 10.5.11.13 X-MC-Unique: D6M6Nt7QN7is47zpY8f4lg-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" With all plumbing in place, we can now enable the new functionality. Signed-off-by: Pavel Mores Reviewed-by: Peter Krempa --- src/qemu/qemu_driver.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9c07b6b393..0cbc746c22 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18544,10 +18544,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))) @@ -18568,6 +18568,13 @@ qemuDomainBlockCommit(virDomainPtr dom, =20 blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); =20 + if (!blockdev && (flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("deleting committed images is only supported for = VMs " + "with blockdev enabled")); + goto endjob; + } + /* Convert bandwidth MiB to bytes, if necessary */ if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES)) { if (speed > LLONG_MAX >> 20) { @@ -18686,7 +18693,8 @@ qemuDomainBlockCommit(virDomainPtr dom, goto endjob; =20 if (!(job =3D qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSourc= e, - baseSource, false))) + 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