From nobody Mon Feb 2 07:31:48 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=1769622915; cv=none; d=zohomail.com; s=zohoarc; b=RNBZ6iBudG8SH9mfraOCF/Ovexin4fWdwNXVP0z0gCctLRWBwHTcjrNQVDXxteMAsjlfpB+jhfMsQu3kTl12GUTfE955RULecAja/8SHFqwjz4rjwaXlsR1N7217qt52ouVl0l4OWMuScl/ufoEIyinneMRjZHh5LVR97io3CzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769622915; 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=85ZrNoN0hK57QU7wjJ5qjRqMHEYl8Ucbj4CnmXX3gKc=; b=YoHuxlm6QdP8e0l5rMYvNOSb2ZjwcQut5nYsLZ+X0JGqHLfD16yUF/9EG12eNPK6wm8DA51QXLnRUdUPGMGYcwXOx3Fu8UNXES3PmsCLDI1unhJ6GAWNj5Nj6KMWaD982n99phCMT3qjysoITv9U4Gn73a3xAvoPyxZx72o9nOw= 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 1769622915950656.2834020131259; Wed, 28 Jan 2026 09:55:15 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2D3983F8E4; Wed, 28 Jan 2026 12:55:15 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 90EAC43F32; Wed, 28 Jan 2026 12:50:24 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 98EFF418CA; 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 C50A541A18 for ; Wed, 28 Jan 2026 12:49:45 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-bT4Fwvg7MTC7LLKzB-viXQ-1; Wed, 28 Jan 2026 12:49:43 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 12D86180057E for ; Wed, 28 Jan 2026 17:49:43 +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 5C51319560B2 for ; Wed, 28 Jan 2026 17:49:42 +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=1769622585; 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=85ZrNoN0hK57QU7wjJ5qjRqMHEYl8Ucbj4CnmXX3gKc=; b=N3rYz/jA6oagGMYpiLltEuLELJ95CANJsJg7CqwJ43W8ZFZkkV4r5kvg/VWQDiFizDSUD6 j9jQzE8OqTl8SXH9SFeSpim/o+9SsBCmFRufO6dLeG6izsGgxB/bZZ/CwNgKoS1V+M/iqk 2hFZdj05mJS8Iwa7A4s5avs2DoL0USc= X-MC-Unique: bT4Fwvg7MTC7LLKzB-viXQ-1 X-Mimecast-MFC-AGG-ID: bT4Fwvg7MTC7LLKzB-viXQ_1769622583 To: devel@lists.libvirt.org Subject: [PATCH 4/5] qemu: migration: Always offer block dirty bitmaps during migration Date: Wed, 28 Jan 2026 18:49:35 +0100 Message-ID: <789c8994412415f7c9f9e67914ffdcb9b77212d5.1769622307.git.pkrempa@redhat.com> 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: 2aJSKCYZ6k5Jn_Uo7N-eecmC-TBOEahvYVdkVTgw-IA_1769622583 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: VXFBB45OIW3NB2J6MFYBJVB74AUEYWWY X-Message-ID-Hash: VXFBB45OIW3NB2J6MFYBJVB74AUEYWWY 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: 1769622917658154100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Until now block dirty bitmaps were offered to destination only if non-shared storage migration was enabled. Upcoming patches will want to support it also in cases when storage is shared but the destination has a qcow2 overlay using the 'data_file' feature where the qcow2 overlay is not actually shared. To support that we'll now always offer bitmaps for migration. The destination can then decide (using existing logic) to pick only the ones that are not present in the image on destination, which is how it was supposed to work even now. The patch removes all the flag checks and simply offers bitmaps in any case. The overhead incurred by this is one 'query-named-block-nodes' call to qemu. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a502515d93..14617a59f4 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2583,16 +2583,13 @@ qemuMigrationAnyConnectionClosed(virDomainObj *vm, * qemuMigrationSrcBeginPhaseBlockDirtyBitmaps: * @mig: migration cookie struct * @vm: domain object - * @migrate_disks: disks which are being migrated - * @nmigrage_disks: number of @migrate_disks * * Enumerates block dirty bitmaps on disks which will undergo storage migr= ation * and fills them into @mig to be offered to the destination. */ static int qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookie *mig, - virDomainObj *vm, - const char **migrate_disks) + virDomainObj *vm) { GSList *disks =3D NULL; @@ -2614,9 +2611,6 @@ qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigra= tionCookie *mig, if (!nodedata) continue; - if (!qemuMigrationAnyCopyDisk(diskdef, migrate_disks)) - continue; - for (j =3D 0; j < nodedata->nbitmaps; j++) { qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap; @@ -2683,7 +2677,6 @@ qemuMigrationSrcBeginXML(virDomainObj *vm, char **cookieout, int *cookieoutlen, unsigned int cookieFlags, - const char **migrate_disks, unsigned int flags) { qemuDomainObjPrivate *priv =3D vm->privateData; @@ -2699,8 +2692,7 @@ qemuMigrationSrcBeginXML(virDomainObj *vm, if (!(mig =3D qemuMigrationCookieNew(vm->def, priv->origname))) return NULL; - if (cookieFlags & QEMU_MIGRATION_COOKIE_NBD && - qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(mig, vm, migrate_disks= ) < 0) + if (qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(mig, vm) < 0) return NULL; if (qemuMigrationCookieFormat(mig, driver, vm, @@ -2882,8 +2874,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver, return NULL; return qemuMigrationSrcBeginXML(vm, xmlin, - cookieout, cookieoutlen, cookieFlags, - migrate_disks, flags); + cookieout, cookieoutlen, cookieFlags, = flags); } @@ -2972,8 +2963,7 @@ qemuMigrationSrcBeginResume(virDomainObj *vm, return NULL; } - return qemuMigrationSrcBeginXML(vm, xmlin, - cookieout, cookieoutlen, 0, NULL, flag= s); + return qemuMigrationSrcBeginXML(vm, xmlin, cookieout, cookieoutlen, 0,= flags); } @@ -4754,7 +4744,6 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmaps(virDomain= Obj *vm, /* For VIR_MIGRATE_NON_SHARED_INC we can migrate the bitmaps directly, * otherwise we must create merged bitmaps from the whole chain */ - if (!(flags & VIR_MIGRATE_NON_SHARED_INC) && qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(vm, mig) < 0) return -1; @@ -4945,7 +4934,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, VIR_AUTOCLOSE fd =3D -1; unsigned long restore_max_bandwidth =3D priv->migMaxBandwidth; virErrorPtr orig_err =3D NULL; - unsigned int cookieFlags =3D 0; + unsigned int cookieFlags =3D QEMU_MIGRATION_COOKIE_BLOCK_DIRTY_BITMAPS; bool abort_on_error =3D !!(flags & VIR_MIGRATE_ABORT_ON_ERROR); bool storageMigration =3D flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_M= IGRATE_NON_SHARED_INC); bool cancel =3D false; @@ -4969,10 +4958,8 @@ qemuMigrationSrcRun(virQEMUDriver *driver, storageMigration =3D qemuMigrationHasAnyStorageMigrationDisks(vm->= def, migrat= e_disks); - if (storageMigration) { + if (storageMigration) cookieFlags |=3D QEMU_MIGRATION_COOKIE_NBD; - cookieFlags |=3D QEMU_MIGRATION_COOKIE_BLOCK_DIRTY_BITMAPS; - } if (virLockManagerPluginUsesState(driver->lockManager) && !cookieout) { @@ -5006,8 +4993,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, cookiein, cookieinlen, cookieFlags | QEMU_MIGRATION_COOKIE_GRAPHICS | - QEMU_MIGRATION_COOKIE_CAPS | - QEMU_MIGRATION_COOKIE_BLOCK_DIRTY_BITMA= PS); + QEMU_MIGRATION_COOKIE_CAPS); if (!mig) goto error; --=20 2.52.0