From nobody Mon Feb 9 23:39:11 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=1588765450; cv=none; d=zohomail.com; s=zohoarc; b=VD0/jsK80d0fGsZouXY5qTDdV/bfGmYIm97JrWF3CftJLvMllHwfj0Csaw9cAL7FnqggxlmE9o5G/qeqSzq0c/d3u7fyD62kqXW6DlgS8JHR3P7N0Y5UoKrPFGDckxSaw/TSXcRFzagQXdJye16/pTLPtasJklihLpBLfbtfzdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588765450; 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=3meF0gRpvBrYpl80orEdWahJ9MudOWm7wJq/uTxrcR8=; b=YnDmGabdxOO0kzSjry6wbgcWhz6OaaLrCZfPq5I9GLkRSKO8KEOdKU5ayS7fpn9IjuA9BE16YOHRZ36gi2VIMZG5OHglyNsGDM/KlFd0SNsSEVT2vxhjtpDFFhNuy2nhntQBcAoLJvnx0SAMsDAckBLkNa7Rua9uTLyjgyxHmnw= 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 1588765450526569.5712886527036; Wed, 6 May 2020 04:44:10 -0700 (PDT) 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-472-5r2bfmpRNoOLRod9R65G3g-1; Wed, 06 May 2020 07:44:07 -0400 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 D3321107ACF6; Wed, 6 May 2020 11:44:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B1C86607F; Wed, 6 May 2020 11:44:01 +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 4A9FF1809543; Wed, 6 May 2020 11:44:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 046BgaGR026801 for ; Wed, 6 May 2020 07:42:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 57A1210021B3; Wed, 6 May 2020 11:42:36 +0000 (UTC) Received: from ibm-p8-15-fsp.mgmt.pnr.lab.eng.rdu2.redhat.com (unknown [10.40.195.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96BD710013D9; Wed, 6 May 2020 11:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588765449; 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=3meF0gRpvBrYpl80orEdWahJ9MudOWm7wJq/uTxrcR8=; b=GsK2zQLC6kP71HEQ4SfOnU5hdjrJMIDDxhAIG0a8Z77wU4tSxmG6kagQnd+IywrnZFF/y9 ZLEJUxCErhHaT7TYDzW/7BmwtmAS1/295l4IMxhQwv8brgSHx10p6YDGiOoYwmqyf5/Anh 8mSp7jwWJNWZ9m5tR6HyfUwifVH8f6g= X-MC-Unique: 5r2bfmpRNoOLRod9R65G3g-1 From: Pavel Mores To: libvir-list@redhat.com Subject: [libvirt PATCH v2 07/10] qemu: block: add function to launch all prepared blockcommits Date: Wed, 6 May 2020 13:42:23 +0200 Message-Id: <20200506114226.2538196-8-pmores@redhat.com> In-Reply-To: <20200506114226.2538196-1-pmores@redhat.com> References: <20200506114226.2538196-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Pavel Mores 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is the second phase of snapshot deletion. We have all information necessary to delete the snapshot by running blockcommits and we haven't detected any problems that would make the deletion unsafe. Now we just launch the blockcommits in parallel. Signed-off-by: Pavel Mores --- src/qemu/qemu_driver.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dc1176bd9c..35b7fb69d5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -154,6 +154,16 @@ static int qemuOpenFileAs(uid_t fallback_uid, gid_t fa= llback_gid, =20 static virQEMUDriverPtr qemu_driver; =20 +static int +qemuDomainBlockCommitCommon(virDomainObjPtr vm, + virQEMUDriverPtr driver, + virDomainDiskDefPtr disk, + virStorageSourcePtr baseSource, + virStorageSourcePtr topSource, + virStorageSourcePtr topParentSource, + unsigned long bandwidth, + unsigned int flags); + static int qemuDomainBlockCommitImpl(virDomainObjPtr vm, virQEMUDriverPtr driver, @@ -16906,6 +16916,31 @@ qemuDomainSnapshotDeleteExternalGetJobDescriptors(= virDomainObjPtr vm, } =20 =20 +static int +qemuDomainSnapshotDeleteExternalLaunchJobs(virDomainObjPtr vm, + virQEMUDriverPtr driver, + const virBlockCommitDesc *block= CommitDescs, + int numDescs) +{ + size_t i; + + for (i =3D 0; i < numDescs; i++) { + virDomainDiskDefPtr disk =3D blockCommitDescs[i].disk; + virStorageSourcePtr baseSource =3D blockCommitDescs[i].baseSource; + virStorageSourcePtr topSource =3D blockCommitDescs[i].topSource; + virStorageSourcePtr topParentSource =3D blockCommitDescs[i].topPar= entSource; + int blockCommitFlags =3D blockCommitDescs[i].blockCommitFlags; + + if (qemuDomainBlockCommitCommon(vm, driver, disk, baseSource, + topSource, topParentSource, + 0, blockCommitFlags) < 0) + return -1; + } + + return 0; +} + + static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, unsigned int flags) --=20 2.24.1