From nobody Sun Feb 8 18:44:53 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=1661272401; cv=none; d=zohomail.com; s=zohoarc; b=CaC+gW0k/qP5Nq9x0lPymkIEW3xuQhx4IQO78LYZpcnGwwHSK9KjkG0Mt/D9uCbWBs5T50Vf3sfOZo2mHfKn932mJbMSAtvfMgawOaeEPZTEtHd8IEY0C4Fkkg8SUu7dGthhsa/7RiIkf4+LBKxeqqjyM7pUJMI6AEZ70Xzc3z4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661272401; 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=K1rBEOrMu7mOml3RLwKD7hOogFJNj4aX6SLhvajF7wU=; b=bP2UIX4NuUtDdpbRkmU/9yA+R1OlFAVXmgGS55dYVJLuFdmlUgSMEgUcclOHymtI8BgdxzDN+5wmwD+YInliqHESnbHDC3YGcWSqoG8XaUT5ymWNIPAtfhCGyik0IKUi4f7jQayoip5sdswG8kKsIdorfxzw3vQ6GNmmjD8Sau0= 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 1661272401351362.96183730488997; Tue, 23 Aug 2022 09:33:21 -0700 (PDT) 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-265-MwMBlZRfPmOwOqPeitTnKw-1; Tue, 23 Aug 2022 12:32:53 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CC17F1044565; Tue, 23 Aug 2022 16:32:37 +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 B669B2166B29; Tue, 23 Aug 2022 16:32:37 +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 8B2421946A62; Tue, 23 Aug 2022 16:32:37 +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 B70E31946A64 for ; Tue, 23 Aug 2022 16:32:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AC12F492C3B; Tue, 23 Aug 2022 16:32:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CF6F40315A for ; Tue, 23 Aug 2022 16:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661272399; 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=K1rBEOrMu7mOml3RLwKD7hOogFJNj4aX6SLhvajF7wU=; b=SaU4+4FE31EYx+jsT2pUxxrGQ8yMwuFiRlNqMbPFwsAUjtZodio0J09oVm/H828pj9M88G 11rpnZb4anhIc/NVREeOFeVPHCd1U8cj/8jtvy9dwuJ75XlcGcM9jSXhDrrXPLkL30KOwR DnSfNK3RY5UaGKvkDONM8J1QTUuxHHg= X-MC-Unique: MwMBlZRfPmOwOqPeitTnKw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt RFC 04/24] qemu_block: add sync option to qemuBlockCommitImpl Date: Tue, 23 Aug 2022 18:32:07 +0200 Message-Id: <278717f62d05255d7c60bbb5a504a6709d6c2bbf.1661271812.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 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 2.78 on 10.11.54.6 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: 1661272403534100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This will allow starting synchronous block commit job that will be used by snapshot delete code. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_block.c | 6 +++++- src/qemu/qemu_block.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 902ec7b2a5..bc46966d22 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -3211,6 +3211,7 @@ qemuBlockCommitImpl(virDomainObj *vm, virStorageSource *topSource, virStorageSource *top_parent, unsigned long bandwidth, + bool sync, unsigned int flags) { qemuDomainObjPrivate *priv =3D vm->privateData; @@ -3338,6 +3339,9 @@ qemuBlockCommitImpl(virDomainObj *vm, !(backingPath =3D qemuBlockGetBackingStoreString(baseSource, false= ))) goto error; =20 + if (sync) + qemuBlockJobSyncBegin(job); + qemuDomainObjEnterMonitor(vm); =20 rc =3D qemuMonitorBlockCommit(priv->mon, @@ -3412,7 +3416,7 @@ qemuBlockCommit(virDomainObj *vm, return -1; =20 return qemuBlockCommitImpl(vm, driver, disk, baseSource, topSource, - top_parent, bandwidth, flags); + top_parent, bandwidth, false, flags); } =20 =20 diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 35f7718697..29b5ac9ea1 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -285,6 +285,7 @@ qemuBlockCommitImpl(virDomainObj *vm, virStorageSource *topSource, virStorageSource *top_parent, unsigned long bandwidth, + bool sync, unsigned int flags); =20 int --=20 2.37.2