From nobody Mon Feb 9 09:01:32 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1701304319276625.9512881464951; Wed, 29 Nov 2023 16:31:59 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9CB451711; Wed, 29 Nov 2023 19:31:58 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 7C9271B9C; Wed, 29 Nov 2023 19:26:51 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 6FB231A63; Wed, 29 Nov 2023 19:26:25 -0500 (EST) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A55F71B58 for ; Wed, 29 Nov 2023 19:25:40 -0500 (EST) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-5c18a3387f5so343445a12.1 for ; Wed, 29 Nov 2023 16:25:40 -0800 (PST) Received: from localhost.localdomain ([118.114.59.192]) by smtp.gmail.com with ESMTPSA id w13-20020a65694d000000b005c6007a13b5sm11650pgq.25.2023.11.29.16.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 16:25:38 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701303939; x=1701908739; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=90Q1Lsnxc9LxqJaXIh3b4cdI9ZMaANcPWJcwE9JyXyg=; b=ssVTqjV18/hWZ/myuGnXkRzHtLXmIqjmkfqd1c+fJetEunEmPYYi0EP+wT1/7/KXT1 nfo5iazybtcVGflkAh9rH+v077xyZy9gZ7BOnPge/Q5BJnbjSmma+CLF8rdH5AJe7NAk ptcIhrvic0rPZPFapJM06728EJju2LU0a7AHXfyANip3KVDRNadawKnCXjkUCvHAkg5l AfEb9K8zVmj5PEeSi8XGAExoTllUq2N+u97TI0lZPriSKEYSFF2ban+SxJP+rI1/fl13 2tuqPNgURQt4M4X2fY5tG/G6udeRwAnK96/4QCIpQNQfClFYb5s91puUM4oeTXJftcVl Lqcg== X-Gm-Message-State: AOJu0YyLBYkCF4wtaybs5LyBZjA8qaBrUWtmbJGpvxh4AURTo32cmE1G Ieal6/JZzPiDsMz2vjl6YRx4aXMQ/45YQHh19R2GabrH X-Google-Smtp-Source: AGHT+IFs2Jl43F9/EUN+SdylNPOf8Jk/5dQ+ObqTe7KTMZ4XCzzufaBsLh5DhYpVoT63/a8suNZyhQ== X-Received: by 2002:a05:6a20:144e:b0:18a:d766:cae1 with SMTP id a14-20020a056a20144e00b0018ad766cae1mr18200983pzi.54.1701303938771; Wed, 29 Nov 2023 16:25:38 -0800 (PST) From: Hyman Huang To: devel@lists.libvirt.org Subject: [PATCH v2 2/4] qemu_migration: Implement VIR_MIGRATE_DIRTY_LIMIT flag Date: Thu, 30 Nov 2023 08:25:24 +0800 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: O6WXF5QWN7QQ2PDP3NVKVUZIHIUAARN3 X-Message-ID-Hash: O6WXF5QWN7QQ2PDP3NVKVUZIHIUAARN3 X-MailFrom: yong.huang@smartx.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 CC: Hyman Huang X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1701304321281000001 Signed-off-by: Hyman Huang --- src/qemu/qemu_migration.c | 8 ++++++++ src/qemu/qemu_migration.h | 1 + src/qemu/qemu_migration_params.c | 6 ++++++ src/qemu/qemu_migration_params.h | 1 + 4 files changed, 16 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index f9c34b72e8..ec653181ff 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2571,6 +2571,14 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver, if (!qemuMigrationSrcIsAllowed(vm, true, vm->job->asyncJob, flags)) return NULL; =20 + if (flags & VIR_MIGRATE_DIRTY_LIMIT && + (!(vm->def->features[VIR_DOMAIN_FEATURE_KVM] =3D=3D VIR_TRISTATE_S= WITCH_ON && + vm->def->kvm_features->features[VIR_DOMAIN_KVM_DIRTY_RING] =3D= =3D VIR_TRISTATE_SWITCH_ON))) { + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("dirtylimit migration requires dirty-ring feature= s enabled")); + return NULL; + } + if (!(flags & (VIR_MIGRATE_UNSAFE | VIR_MIGRATE_OFFLINE)) && !qemuMigrationSrcIsSafe(vm->def, priv->qemuCaps, nmigrate_disks, migrate_disks, flags)) diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index ed62fd4a91..a2a598fe28 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -62,6 +62,7 @@ VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES | \ VIR_MIGRATE_POSTCOPY_RESUME | \ VIR_MIGRATE_ZEROCOPY | \ + VIR_MIGRATE_DIRTY_LIMIT | \ 0) =20 /* All supported migration parameters and their types. */ diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 79fe6e97c8..797293d8e7 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -99,6 +99,7 @@ VIR_ENUM_IMPL(qemuMigrationCapability, "dirty-bitmaps", "return-path", "zero-copy-send", + "dirty-limit", ); =20 =20 @@ -194,6 +195,11 @@ static const qemuMigrationParamsFlagMapItem qemuMigrat= ionParamsFlagMap[] =3D { VIR_MIGRATE_ZEROCOPY, QEMU_MIGRATION_CAP_ZERO_COPY_SEND, QEMU_MIGRATION_SOURCE}, + + {QEMU_MIGRATION_FLAG_REQUIRED, + VIR_MIGRATE_DIRTY_LIMIT, + QEMU_MIGRATION_CAP_DIRTY_LIMIT, + QEMU_MIGRATION_SOURCE}, }; =20 /* Translation from VIR_MIGRATE_PARAM_* typed parameters to diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index 5857673227..44a44aae07 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -40,6 +40,7 @@ typedef enum { QEMU_MIGRATION_CAP_BLOCK_DIRTY_BITMAPS, QEMU_MIGRATION_CAP_RETURN_PATH, QEMU_MIGRATION_CAP_ZERO_COPY_SEND, + QEMU_MIGRATION_CAP_DIRTY_LIMIT, =20 QEMU_MIGRATION_CAP_LAST } qemuMigrationCapability; --=20 2.39.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org