From nobody Mon Feb 9 01:21:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1613057924; cv=none; d=zohomail.com; s=zohoarc; b=cWrRpvEVFi2gYGZOKHt1aCHFTzjDXSbfkWyvM81C4vTVxolH8ILs6fHn9sO9T20ev4kog5Gjc2SW64b03PE/wg4DphbvqLDdgiEDOLeq7AznCF/A5UzC8zn9C3AfV0JIWAMTBUtVUAi8zaorclIx0bOWI7zWRrhF7y0taTPuG9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613057924; 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=XwkpWvCyKF18E4gF+qQfCSJhl4Wkxvq6U/D8NDTxBlM=; b=e2kT1NEpO1wCTLJj9XhRrqjkIIVCT4uBWmWDaeCRpipekMZ/Qp4VQT3N9oX4Hwhc8+aidN2EWvn2NPFWRingBCN6d06u8gm7uGRvCBgvdZmzJN/BvG68jNfc2dwgc57ApU3ax0wh5xJLEdzNH9OBXLiGm7/c7YdXVKZsM2rtZW4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1613057924363728.8576725492641; Thu, 11 Feb 2021 07:38:44 -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-248-3d51aqssNLCuZf4hmtgSgQ-1; Thu, 11 Feb 2021 10:38:40 -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 7A9ED879A0D; Thu, 11 Feb 2021 15:38:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C1465C290; Thu, 11 Feb 2021 15:38:32 +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 D108B18089D3; Thu, 11 Feb 2021 15:38:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11BFcGvw019187 for ; Thu, 11 Feb 2021 10:38:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id CD90E5D767; Thu, 11 Feb 2021 15:38:16 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 294405D74F for ; Thu, 11 Feb 2021 15:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613057923; 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=XwkpWvCyKF18E4gF+qQfCSJhl4Wkxvq6U/D8NDTxBlM=; b=C8O8LMzPgESLKLf/bdU/Pbk61vAbNai3gyt+ymN+qOxHleGXolQ6E4L4/ye8pfuLMF5KYy IB/YyL+GqlW+wlP0LB54njKoI4NzBbpMH45mKK5ZJ3hHJEMlRuEVB50lCjv9hBNloussKI N8Wbeq+Iecb/xEicSo0wP/3WXl67rQ4= X-MC-Unique: 3d51aqssNLCuZf4hmtgSgQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/19] qemu: migration_params: Add infrastructure for 'dirty-bitmaps' migration feature Date: Thu, 11 Feb 2021 16:37:50 +0100 Message-Id: <827da136e28560fa8e1d0ca9b5d2c651f95e4869.1613057278.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" Add the migration capability flag and the propagation of the corresponding mapping configuration. The mapping will be produced from the bitmaps on disk depending on both sides of the migration and the necessity to perform merges. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_params.c | 24 ++++++++++++++++++++++++ src/qemu/qemu_migration_params.h | 5 +++++ 2 files changed, 29 insertions(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 510dad783a..8f491e0ed2 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -63,6 +63,7 @@ struct _qemuMigrationParams { unsigned long long compMethods; /* bit-wise OR of qemuMigrationCompres= sMethod */ virBitmapPtr caps; qemuMigrationParamValue params[QEMU_MIGRATION_PARAM_LAST]; + virJSONValuePtr blockDirtyBitmapMapping; }; typedef enum { @@ -89,6 +90,7 @@ VIR_ENUM_IMPL(qemuMigrationCapability, "pause-before-switchover", "late-block-activate", "multifd", + "dirty-bitmaps", ); @@ -265,6 +267,7 @@ qemuMigrationParamsFree(qemuMigrationParamsPtr migParam= s) } virBitmapFree(migParams->caps); + virJSONValueFree(migParams->blockDirtyBitmapMapping); g_free(migParams); } @@ -524,6 +527,20 @@ qemuMigrationParamsSetCompression(virTypedParameterPtr= params, } +void +qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParamsPtr migPa= rams, + virJSONValuePtr *params) +{ + virJSONValueFree(migParams->blockDirtyBitmapMapping); + migParams->blockDirtyBitmapMapping =3D g_steal_pointer(params); + + if (migParams->blockDirtyBitmapMapping) + ignore_value(virBitmapSetBit(migParams->caps, QEMU_MIGRATION_CAP_B= LOCK_DIRTY_BITMAPS)); + else + ignore_value(virBitmapClearBit(migParams->caps, QEMU_MIGRATION_CAP= _BLOCK_DIRTY_BITMAPS)); +} + + qemuMigrationParamsPtr qemuMigrationParamsFromFlags(virTypedParameterPtr params, int nparams, @@ -747,6 +764,12 @@ qemuMigrationParamsToJSON(qemuMigrationParamsPtr migPa= rams) return NULL; } + if (migParams->blockDirtyBitmapMapping && + virJSONValueObjectAppend(params, "block-bitmap-mapping", + migParams->blockDirtyBitmapMapping) < 0) + return NULL; + migParams->blockDirtyBitmapMapping =3D NULL; + return g_steal_pointer(¶ms); } @@ -1202,6 +1225,7 @@ qemuMigrationParamsReset(virQEMUDriverPtr driver, goto cleanup; qemuMigrationParamsResetTLS(driver, vm, asyncJob, origParams, apiFlags= ); + /* We don't reset 'block-bitmap-mapping' as it can't be unset */ cleanup: virErrorRestore(&err); diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index 9876101bfc..f1db42ce94 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -39,6 +39,7 @@ typedef enum { QEMU_MIGRATION_CAP_PAUSE_BEFORE_SWITCHOVER, QEMU_MIGRATION_CAP_LATE_BLOCK_ACTIVATE, QEMU_MIGRATION_CAP_MULTIFD, + QEMU_MIGRATION_CAP_BLOCK_DIRTY_BITMAPS, QEMU_MIGRATION_CAP_LAST } qemuMigrationCapability; @@ -132,6 +133,10 @@ qemuMigrationParamsGetULL(qemuMigrationParamsPtr migPa= rams, qemuMigrationParam param, unsigned long long *value); +void +qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParamsPtr migPa= rams, + virJSONValuePtr *params); + int qemuMigrationParamsCheck(virQEMUDriverPtr driver, virDomainObjPtr vm, --=20 2.29.2