From nobody Mon Feb 2 07:31:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1769622857; cv=none; d=zohomail.com; s=zohoarc; b=d5iEk0AIjnREPlb7Bt46ivSX0GNIVcM1wkWW94O5/Z8krui460nRouDIoSlzndHC/kwDIqCVKETMuuG560l578b3txVsg0J7pVL4cD+pE4tAJVtCacNwY8LAwa43f9RKPgv97v23GhHMAsOMvnQZq+h6h+oxqf0KRhvJ7rSSLJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769622857; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=Jmues4UfGHGEGot1+TS/D2bGcN17uAOFC5t/uuatHOU=; b=KEjnNMKB7iNY+dn00gS1gAnHzJ9QJYBxilsl1ZE9CfzKO4sUn0RyrGelfFWB4RPF4QoH6LRQK32mlpeaeVy3y4rk329hVI7eah/tbQGhcul2EAWB2elgn0HJv7NsAHxMVbXwS58lssz+WFBPJdIFmeUO9OzPimc22P/lrZy9JwA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769622857021215.1278609978507; Wed, 28 Jan 2026 09:54:17 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 37FF141BB5; Wed, 28 Jan 2026 12:54:16 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id D4DFF43EBF; Wed, 28 Jan 2026 12:50:23 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2D65E418E2; Wed, 28 Jan 2026 12:50:12 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id CB6EB41A52 for ; Wed, 28 Jan 2026 12:49:46 -0500 (EST) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-lO90UC92OwaUuwnEAlmnGw-1; Wed, 28 Jan 2026 12:49:45 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4FB481955DB1 for ; Wed, 28 Jan 2026 17:49:44 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7C02219560B2 for ; Wed, 28 Jan 2026 17:49:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769622586; h=from:from: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; bh=Jmues4UfGHGEGot1+TS/D2bGcN17uAOFC5t/uuatHOU=; b=aeQ4kc7R2sYbxlsuapc5R74S7QjuwzDRqWderhbfsMeKCAzy91fbvprUZJUTluYKjbbshz WCKK81LA/gz9XI3t5MvNctUT5iep9EuN4/ErmAvhm4Q3XG97zHb3Nmj99OqJdoLLLJgQnS trtBCwL8fCjjkroUoJbo+Lfr50gABDE= X-MC-Unique: lO90UC92OwaUuwnEAlmnGw-1 X-Mimecast-MFC-AGG-ID: lO90UC92OwaUuwnEAlmnGw_1769622584 To: devel@lists.libvirt.org Subject: [PATCH 5/5] qemuMigrationDstPrepareAnyBlockDirtyBitmaps: Always consider offered bitmaps Date: Wed, 28 Jan 2026 18:49:36 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wZi8nfDCMZKmmWqjNS9BDSH4KwkiO7HPgssjSt45AbE_1769622584 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EEU72CZ76XFAVFZDVX5DZ56JE3XPVHRO X-Message-ID-Hash: EEU72CZ76XFAVFZDVX5DZ56JE3XPVHRO X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769622858422158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Consider bitmaps for incoming migration regardless of non-shared storage flag. When bitmaps are offered from the source, consult the local image if the bitmap is present and if not accept migration. Migration of bitmaps which exist in the qcow2 metadata is skipped because qemu rejects such setup (although handles it correctly in case of shared storage setup; see below). This allows bitmap propagation for cases when the qcow2 image is not actually shared between destinations but the data is (using the data_file feature). At the same time this preserves existing bitmap handling semantics for other cases. Specifically qemu, in case of shared storage properly propagates the bitmap which was already recorded in the qcow2 metadata on disk even if libvirt doesn't instruct migration, yet tolerates migration instruction if the file is not yet recorded in the on-disk metadata. In both cases the contents are preserved correctly. When storage is not shared (which includes even cases when we migrate it via NBD) it's expected that the bitmaps don't exist on the destination and thus all will be picked for migration. We can also infer that this wasn't ever a problem by the fact that the code skipping migration of existing bitmaps was broken until recently, and qemu would refuse such config. I've tested all the above scenarios including verifying that the resulting bitmaps capture dirtied regions before and after migration. For testing this the following command is useful: virsh qemu-monitor-command --domain DOMNAME --hmp 'qemu-io -d /machine/pe= ripheral/virtio-disk0/virtio-backend "write -P 0xcc 4M 1M"' Which simulates a write from the guest side without the need to interact with the guest OS. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 14617a59f4..b4d2e27370 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3186,7 +3186,6 @@ qemuMigrationDstPrepare(virQEMUDriver *driver, * @vm: domain object * @mig: migration cookie * @migParams: migration parameters - * @flags: migration flags * * Checks whether block dirty bitmaps offered by the migration source are * to be migrated (e.g. they don't exist, the destination is compatible et= c) @@ -3197,16 +3196,13 @@ qemuMigrationDstPrepare(virQEMUDriver *driver, static int qemuMigrationDstPrepareAnyBlockDirtyBitmaps(virDomainObj *vm, qemuMigrationCookie *mig, - qemuMigrationParams *migParams, - unsigned int flags) + qemuMigrationParams *migParams) { g_autoptr(virJSONValue) mapping =3D NULL; g_autoptr(GHashTable) blockNamedNodeData =3D NULL; GSList *nextdisk; - if (!mig->nbd || - !mig->blockDirtyBitmaps || - !(flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_IN= C))) + if (!mig->blockDirtyBitmaps) return 0; if (qemuMigrationCookieBlockDirtyBitmapsMatchDisks(vm->def, mig->block= DirtyBitmaps) < 0) @@ -3353,7 +3349,7 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver, goto error; } - if (qemuMigrationDstPrepareAnyBlockDirtyBitmaps(vm, mig, migParams, fl= ags) < 0) + if (qemuMigrationDstPrepareAnyBlockDirtyBitmaps(vm, mig, migParams) < = 0) goto error; if (qemuMigrationParamsCheck(vm, VIR_ASYNC_JOB_MIGRATION_IN, migParams, --=20 2.52.0