From nobody Sun Feb 8 19:56:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; 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.61 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=1583342836; cv=none; d=zohomail.com; s=zohoarc; b=hFLRX+Jn5oeUgA/8ON5gZdEP+lpMT79PJMK0NmT48KfBmBKqVz6tDch1xpLujNxH+AhZtal8gzRzINBZnQ9H4+6DxVA1RGMM7j67bjwU+6SNc/CuqAictpqYVOy51Oo6rn+m05ZYqHH+8Vp4N4OwW2TKr49WyeEqwSsdX4oCm2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583342836; 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=jJGgeTeoBV90Chrsj1oEZidXSqNLqRcqIfX2DxLgSHg=; b=NeYtnt5pNsdnLF6QXMGt/ovboVbGVVf6BxHzgpt5eW57yiP8Vi/LRCVx029x8/MfGPLH8oT1hzwqayBAZHWn6QORp5X2AHx0rTvIbYwjBYfzVzkNpzzPLcCTUTb9mckr4AHtU0NodClrluKaS2z3iz4nY/2pM5g6/sZMoKHnpA4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1583342836144516.3249211212303; Wed, 4 Mar 2020 09:27:16 -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-20-kDbudaR9P_OUr67uZskodg-1; Wed, 04 Mar 2020 12:27:11 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BB3CC107B114; Wed, 4 Mar 2020 17:27:03 +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 9AAFD8B74D; Wed, 4 Mar 2020 17:27:03 +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 50707860D7; Wed, 4 Mar 2020 17:27:03 +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 024HQv8r027399 for ; Wed, 4 Mar 2020 12:26:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 847828F370; Wed, 4 Mar 2020 17:26:57 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAF8819E9C; Wed, 4 Mar 2020 17:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583342834; 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=jJGgeTeoBV90Chrsj1oEZidXSqNLqRcqIfX2DxLgSHg=; b=VB5P40BEp75c+f5/BgURYnSxRpXlym8sEpVpwhESYGEBJcfjGZXH2NWLcbgSXEAlr0Qm+p F/MuFoxKCEggpO8pHcfNf9gk+RLIAhRCDB07OiOUUI0xY/XQPAjszkdPt+SRh6tcDJpzFS aLzAK7tZjtQwodO74Si0hQGPplhX3iI= X-MC-Unique: kDbudaR9P_OUr67uZskodg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/13] qemuDomainBlockPivot: Handle merging of bitmaps when pivoting an active block-commit Date: Wed, 4 Mar 2020 18:26:39 +0100 Message-Id: <25f71c67fc29367c43ff04a06c1493a7cc6b48da.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.11 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" Active layer block commit makes the 'base' image the new top image of the disk after it finishes. This means that all bitmap operations need to be handled prior to this happening as we'd lose writes otherwise. The ideal place is to handle it when pivoting to the new image as only guest-writes would be happening after this point. Use qemuBlockBitmapsHandleCommitFinish to calculate the merging transaction. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 85612f3281..bc3e495064 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17288,6 +17288,21 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, break; case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT: + if (blockdev && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) { + g_autoptr(virHashTable) blockNamedNodeData =3D NULL; + + if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEM= U_ASYNC_JOB_NONE))) + return -1; + + if (qemuBlockBitmapsHandleCommitFinish(job->data.commit.top, + job->data.commit.base, + blockNamedNodeData, + &actions, + job->data.commit.disabl= edBitmapsBase) < 0) + return -1; + } + break; } --=20 2.24.1