From nobody Mon Feb 9 00:30:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1583342917; cv=none; d=zohomail.com; s=zohoarc; b=J2tsuimu5Bd284zzcawlg54qOkJINTVjKPhZRHA/+kEGfXx0oOboD+FG+2Rsf2Mz7u2k/2EE5FnJYcUC5yjSq8CbBg7bKv6E3YUhBlSs+IoloTnIy7QjT/8eA/5xIj7YB7iYwo2Gfktkv9flJRljiO+16ACfSntF59sq5ZkSWRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583342917; 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=wFtl1lFKbLw2K2v79WIc53FVkvRW+qvr2rzUt4glYP8=; b=mYCMDwNHvoFXldoIb5nBVqQSoZSrzqRvWVqrbWneeOlRURu94TAN9PKNO8R1m/iTKoCti+zTadbfTnQxt/Hg0tdSowAvk9ryI93UzJopP33S5JnQGg60Xy2pYqP3t9h6cIvNiy6FzSGCwm+xPUkVksUnAiSgu+Gd9fzwX8Q7IKM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 1583342917393275.738776051532; Wed, 4 Mar 2020 09:28:37 -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-367-JVgwAoq7NJ6lidCb-QSMQA-1; Wed, 04 Mar 2020 12:27:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A45B800053; Wed, 4 Mar 2020 17:27:19 +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 E31B45C1D8; Wed, 4 Mar 2020 17:27:18 +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 9450A86A12; Wed, 4 Mar 2020 17:27:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 024HQwOe027405 for ; Wed, 4 Mar 2020 12:26:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 768368D55E; Wed, 4 Mar 2020 17:26:58 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id C92D219E9C; Wed, 4 Mar 2020 17:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583342916; 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=wFtl1lFKbLw2K2v79WIc53FVkvRW+qvr2rzUt4glYP8=; b=XFW0eEzfdb/uRjAi15ZTdwFNK2xeeVF3UL/rN6D+Gf6iS+xMTQ6kdG+Y9VITOFf+xS49eS IdJr76BomBZj4JloHab2Gpp8bdR0tDdDdEwpX9ABHRSS1i6IVNY3tT7peCKSRSV4ghDv7b g72km/saLn2czJShowcxR1SLTAaVG7I= X-MC-Unique: JVgwAoq7NJ6lidCb-QSMQA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 12/13] qemu: blockjob: Handle bitmaps after finish of normal block-commit Date: Wed, 4 Mar 2020 18:26:40 +0100 Message-Id: <7ba5e477b410bb143b94cf095df0fd14a42a4b50.1583342236.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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.16 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" Merge the bitmaps into base of the block commit after the job finishes. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 44c0dc2c16..904c4c3f46 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1049,6 +1049,53 @@ qemuBlockJobDeleteImages(virQEMUDriverPtr driver, } } + +/** + * qemuBlockJobProcessEventCompletedCommitBitmaps: + * + * Handles the bitmap changes after commit. This function shall return -1 = on + * monitor failures. + */ +static int +qemuBlockJobProcessEventCompletedCommitBitmaps(virDomainObjPtr vm, + qemuBlockJobDataPtr job, + qemuDomainAsyncJob asyncJob) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + g_autoptr(virHashTable) blockNamedNodeData =3D NULL; + g_autoptr(virJSONValue) actions =3D NULL; + + if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, asyncJob))) + return -1; + + if (qemuBlockBitmapsHandleCommitFinish(job->data.commit.top, + job->data.commit.base, + blockNamedNodeData, + &actions, + job->data.commit.disabledBitmap= sBase) < 0) + return 0; + + if (!actions) + return 0; + + if (qemuBlockReopenReadWrite(vm, job->data.commit.base, asyncJob) < 0) + return -1; + + if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0) + return -1; + + qemuMonitorTransaction(priv->mon, &actions); + + if (qemuDomainObjExitMonitor(priv->driver, vm) < 0) + return -1; + + if (qemuBlockReopenReadOnly(vm, job->data.commit.base, asyncJob) < 0) + return -1; + + return 0; +} + + /** * qemuBlockJobProcessEventCompletedCommit: * @driver: qemu driver object @@ -1106,6 +1153,9 @@ qemuBlockJobProcessEventCompletedCommit(virQEMUDriver= Ptr driver, if (!n) return; + if (qemuBlockJobProcessEventCompletedCommitBitmaps(vm, job, asyncJob) = < 0) + return; + /* revert access to images */ qemuDomainStorageSourceAccessAllow(driver, vm, job->data.commit.base, = true, false); if (job->data.commit.topparent !=3D job->disk->src) --=20 2.24.1