From nobody Mon Sep 16 19:23:47 2024 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; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nutanix.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1718723377136580.7573003407733; Tue, 18 Jun 2024 08:09:37 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DD027D57; Tue, 18 Jun 2024 11:09:35 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 94468C69; Tue, 18 Jun 2024 11:09:07 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 2825CB0E; Tue, 18 Jun 2024 11:02:26 -0400 (EDT) Received: from mx0a-002c1b01.pphosted.com (mx0a-002c1b01.pphosted.com [148.163.151.68]) (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 26A30C5E for ; Tue, 18 Jun 2024 11:02:25 -0400 (EDT) Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45I8JpfF030552; Tue, 18 Jun 2024 07:54:59 -0700 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3ys6v5wrse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jun 2024 07:54:59 -0700 (PDT) Received: from LV8PR02MB10287.namprd02.prod.outlook.com (2603:10b6:408:1fa::10) by CH3PR02MB9932.namprd02.prod.outlook.com (2603:10b6:610:174::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Tue, 18 Jun 2024 14:54:57 +0000 Received: from LV8PR02MB10287.namprd02.prod.outlook.com ([fe80::b769:6234:fd94:5054]) by LV8PR02MB10287.namprd02.prod.outlook.com ([fe80::b769:6234:fd94:5054%3]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 14:54:57 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 445 seconds by postgrey-1.37 at lists.libvirt.org; Tue, 18 Jun 2024 11:02:25 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=proofpoint20171006; bh=ntfqKJfD+5O87 jkbHuyoGwqlyjqhAvPyVihnckueZJM=; b=KSfrHXOdw6GrwkMrmdgENUSy9cjyK 42dp6VdbzMLmx1DPCTyJfYp2tz1g1OuKR8mMFrvJIIPoXinOvL/Oziwyfgh6HqYp cfNon05GahB66Jrul6cA16xqETwTU2Hd8QLHiVKQ6gJ+iglgFPVt8emWnqmnS/jG 2qJZmir5n5PpruCGv+MMgGE9pVmusqK7Hx89vYc11JpR62xQN5XYBNkgVcLLMK2d 1dIQXkhovE+vAi8U5B0j+uSzDy4e6nknLcNTvWG3MoqAh6lH1ldt7qbaJnHoeoTm 884J7/LPOwydgLGpWD6a6u6WlYQpZU/Ide8YVyEbHR+LWs3LRLqrM/uUw== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CEPh5rLuNFsrghadK2i5AQdmH3jKZAIBg1mpcCC5rtj4xYRy9U5doqkSEj85bBLEhvayrHEl2px8N5qMh1h+M9dHCjiVFVeuBSEb76g3HnCwevCVt1ZPrr+P6oBXpJTi9K8fU+DkU4cZQCzUeZSjvr3KKWHCFEFCRZdDtpAdqszzzDgWo/S7nL+yeQ8/BoWYCRgpSBusXWddWzBtd1P/tBr4vQh+0SGaDO+5LQ9Hxh5DgQ9USeg0+poUWfFPcK5bDIvYgsJnHdvY1gtklekaVruIuNkoOa2i2OSthQewKZWvfmFLZJsc3NTONBS8x7dSp/5M3Y7BKSZ5nsSLk6/mIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ntfqKJfD+5O87jkbHuyoGwqlyjqhAvPyVihnckueZJM=; b=SO70lHuoPAuEuOUPT2ghnrbvQcnhr/p1a5eTSpVCIUPxyNnUpNjW7yAAk7C41yv+/dkov6uPSuRI5n2dHGA7ZpZpKVgYvrgS8N76mCQtNvpwj/b7Qs2z8l41bGZUMq9yMNfc8az5CL0pWWAK1y3117sRLnuOT0E60at048E2TFiZ8wXvsKG3RZ5olg9u8gAmKljcNR0DkJkG4BrMcvExMrdu6A/YTokhGtg4JYp5fLtD278LitoYzIA4IFY89OhUyGgNCOO9XmnhOEEC0/cLlkY1x87H9BulYcL/nei/PreX5YP2T6yF6shl6z/rTpWuy8vRnpBLoMq6ovz/HwvdMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ntfqKJfD+5O87jkbHuyoGwqlyjqhAvPyVihnckueZJM=; b=aO03w/F7a0bUaCvHCgbqQZI1FgKgwQZhoCi6uylkA5d2AvMyfFEZ/pvo7ev8v5mGptHIWdw47TgacImh4ZZMpVm5p1t9p7x4n9sWhX7R8zHw/Mncit/948/SJxla8BUzvuDfFVDKJGXAyIvTHIg4tLCr1JjoaErVq1LbqQLnBuWK8ozptAERZrxsuJtaEbV3T965AcJWyKcZxVr2p2uu4Sl9w5NwHhwwlAPZOn1DLggIoqXtuAEZjcBwJFzuzW89wW3l8C8IJ7plNfE8Wt1+wO8BezGF3Etvav1fBuWA5fflXCsjfZLbVL4/JQ5tc8n5hoUftjiHabLt/smVr2BVfg== From: Jon Kohler To: devel@lists.libvirt.org Subject: [PATCH] qemu: add support for qemu switchover-ack Date: Tue, 18 Jun 2024 08:06:06 -0700 Message-ID: <20240618150611.3858193-1-jon@nutanix.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: BY1P220CA0007.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:59d::13) To LV8PR02MB10287.namprd02.prod.outlook.com (2603:10b6:408:1fa::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV8PR02MB10287:EE_|CH3PR02MB9932:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a7f306c-53de-47bc-0618-08dc8fa69ed9 x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|52116011|1800799021|376011|366013|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?VD0ir1gxMCUR7gw96lxTJUHFdjlXJOoC39Z8jTlq+Slrj/BpKOw34VAD8dPp?= =?us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7nEC2CBh+y?= =?us-ascii?Q?/9LUAMjZ72coZHdKKmYBHt/wquX/vGbM0ij7Dky3pU5OUsskiEn1JrE2C4GT?= =?us-ascii?Q?pYtA6MbevWKltFbjmJPgiCyAu4Ok/l2YYN3mxwiM3cBtbGbuFz07c49leJH/?= =?us-ascii?Q?bYneVXfwjOZrLonmggRf7PpUnaiMUNjdLSqUVYnUgHWR59c4XVtCWmfEjBWK?= =?us-ascii?Q?MrvAFgNoCsnpFbzJE5YdYOA0tYz+4cyM3Cnjswa4ZiR9Qp2VYEiOH+Gr988F?= =?us-ascii?Q?nEj8sLS7WYd+QY33IA2qaMYLti8+JWPRnIasD0rfWnMsKa78nrDuBlfwwT7n?= =?us-ascii?Q?xwfY4caURaeFa5HwCY/rlg1V9trTt09AnelKN7ajoZm0I8K8x49tLvUnLwVi?= =?us-ascii?Q?63MmoIy3t/V/ZTTr6poRLt5K?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV8PR02MB10287.namprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(52116011)(1800799021)(376011)(366013)(38350700011);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Ml6kfWh1os+CGMIzuPx4pzwS8HDzMQKA4EMeo8OKiYYv29sMTkxlrTW8Uzu4?= =?us-ascii?Q?4uTJU0PZyyOTXri7eDbyHhHm0cwNoLxI9Og19SbPP466c6XtPWh6fRhXw5CF?= =?us-ascii?Q?VOBKTYeVpExkgIr9XhTL6uDjooDSmIVv9ufuEHzWoL5HaCBOCv0ic14S62M6?= =?us-ascii?Q?9cm60iVhwcTlvHG6aShLA5uzBWy8T0mGO2DScH9GLPLSAALA/8i7i4gTw7G8?= =?us-ascii?Q?/sBnrZyRXq+9Q/qaSRPyYUDk+5HFCjfpIjisFD2+67CtWngjUQvGWZCia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0m7Q7wCaUJOTs0/HLRq880IqJ3f?= =?us-ascii?Q?iAiPUZdAZp00vAURud//fw9LjVE6cjmlpEDgCLCH0F9YuNzGRD7aGIiLe3sj?= =?us-ascii?Q?onHgHYLM8AXWfco3pzTxCSEENN+yIxh9aab/wt6vhwsU+7vxv2kDipZoYKch?= =?us-ascii?Q?5q0mx5iMqyVjBJsD48pj2v3wb/KNtG3EuVod8oeYn/bxAjEozyQpVogdERMK?= =?us-ascii?Q?d15oYT8P39MqrY/m618N9Leu0eeAlp/tEetNGSq6ooLIxxL0GcxmSQrh7CwB?= =?us-ascii?Q?P+9CJVK5EjMInks0unWv3ajC0BfYZqxVItSMiQ7X3B2EUp+WWNJXlBLggsrc?= =?us-ascii?Q?SoE2q9S4xk41ljoT67WIKHv4SDuXGW5HWRe0ThRF5SNZubcO3PSCLBpaL9Fr?= =?us-ascii?Q?IdcD/B/Kjv1HXKC0LITVMaPosVoPbIegTAh9GonCE0S4uVMSLButjLSmRvhX?= =?us-ascii?Q?Rg=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a7f306c-53de-47bc-0618-08dc8fa69ed9 X-MS-Exchange-CrossTenant-AuthSource: LV8PR02MB10287.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 14:54:57.3096 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4lm0XRFii1h1XX7Aoc9GWRZIHLDT7BFbnZWWEuHVzBmJQHJcchZkhZA/AYQJZcy+GH+lSAXgLQfniWSsr6QgQjPLvDjzuIS73SXONZUxsxE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR02MB9932 X-Proofpoint-GUID: jtGJhUqI43BlQdMvor0scJQmM-GwbS1V X-Proofpoint-ORIG-GUID: jtGJhUqI43BlQdMvor0scJQmM-GwbS1V X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-18_02,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Reason: safe Content-Transfer-Encoding: quoted-printable X-MailFrom: jon@nutanix.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 Message-ID-Hash: 2XCWPYAUE7HUIMSAYYWAUUYGGZ6WYR53 X-Message-ID-Hash: 2XCWPYAUE7HUIMSAYYWAUUYGGZ6WYR53 X-Mailman-Approved-At: Tue, 18 Jun 2024 15:09:05 -0400 CC: Jon Kohler , Avihai Horon , Markus Armbruster , Peter Xu , YangHang Liu 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: X-ZohoMail-DKIM: fail (found 2 invalid signatures) X-ZM-MESSAGEID: 1718723378896100001 Content-Type: text/plain; charset="utf-8" Add plumbing for QEMU's switchover-ack migration capability, which helps lower the downtime during VFIO migrations. This capability is enabled by default as long as both the source and destination support it. Note: switchover-ack depends on the return path capability, so this may not be used when VIR_MIGRATE_TUNNELLED flag is set. Extensive details about the qemu switchover-ack implementation are available in the qemu series v6 cover letter [1] where the highlight is the extreme reduction in guest visible downtime. In addition to the original test results below, I saw a roughly ~20% reduction in downtime for VFIO VGPU devices at minimum. =3D=3D=3D Test results =3D=3D=3D The below table shows the downtime of two identical migrations. In the first migration swithcover ack is disabled and in the second it is enabled. The migrated VM is assigned with a mlx5 VFIO device which has 300MB of device data to be migrated. +----------------------+-----------------------+----------+ | Switchover ack | VFIO device data size | Downtime | +----------------------+-----------------------+----------+ | Disabled | 300MB | 1900ms | | Enabled | 300MB | 420ms | +----------------------+-----------------------+----------+ Switchover ack gives a roughly 4.5 times improvement in downtime. The 1480ms difference is time that is used for resource allocation for the VFIO device in the destination. Without switchover ack, this time is spent when the source VM is stopped and thus the downtime is much higher. With switchover ack, the time is spent when the source VM is still running. [1] https://patchwork.kernel.org/project/qemu-devel/cover/20230621111201.29= 729-1-avihaih@nvidia.com/ Signed-off-by: Jon Kohler Cc: Alex Williamson Cc: Avihai Horon Cc: Markus Armbruster Cc: Peter Xu Cc: YangHang Liu --- include/libvirt/libvirt-domain.h | 11 +++++++++++ src/libvirt-domain.c | 20 ++++++++++++++++++++ src/qemu/qemu_migration.h | 1 + src/qemu/qemu_migration_params.c | 8 +++++++- src/qemu/qemu_migration_params.h | 1 + 5 files changed, 40 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 2f5b01bbfe..9543629f30 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1100,6 +1100,17 @@ typedef enum { * Since: 8.5.0 */ VIR_MIGRATE_ZEROCOPY =3D (1 << 20), + + /* Use switchover ack migration capability to reduce downtime on VFIO + * device migration. This prevents the source from stopping the VM and + * completing the migration until an ACK is received from the destinat= ion + * that it's OK to do so. Thus, a VFIO device can make sure that its + * initial bytes were sent and loaded in the destination before the + * source VM is stopped. + * + * Since: 10.5.0 + */ + VIR_MIGRATE_SWITCHOVER_ACK =3D (1 << 21), } virDomainMigrateFlags; =20 =20 diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 7c6b93963c..786fef317d 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3822,6 +3822,10 @@ virDomainMigrate(virDomainPtr domain, VIR_MIGRATE_PARALLEL, error); =20 + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED, + VIR_MIGRATE_SWITCHOVER_ACK, + error); + VIR_REQUIRE_FLAG_GOTO(VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES, VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SH= ARED_INC, error); @@ -4021,6 +4025,10 @@ virDomainMigrate2(virDomainPtr domain, VIR_MIGRATE_PARALLEL, error); =20 + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED, + VIR_MIGRATE_SWITCHOVER_ACK, + error); + VIR_REQUIRE_FLAG_GOTO(VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES, VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SH= ARED_INC, error); @@ -4497,6 +4505,10 @@ virDomainMigrateToURI(virDomainPtr domain, VIR_MIGRATE_PARALLEL, error); =20 + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED, + VIR_MIGRATE_SWITCHOVER_ACK, + error); + if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0) goto error; =20 @@ -4577,6 +4589,10 @@ virDomainMigrateToURI2(virDomainPtr domain, VIR_MIGRATE_PARALLEL, error); =20 + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED, + VIR_MIGRATE_SWITCHOVER_ACK, + error); + if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0) goto error; =20 @@ -4656,6 +4672,10 @@ virDomainMigrateToURI3(virDomainPtr domain, VIR_MIGRATE_PARALLEL, error); =20 + VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED, + VIR_MIGRATE_SWITCHOVER_ACK, + error); + if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0) goto error; =20 diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index ed62fd4a91..cd89e100e1 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_SWITCHOVER_ACK | \ 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 48f8657f71..9593b6ba65 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -105,6 +105,7 @@ VIR_ENUM_IMPL(qemuMigrationCapability, "return-path", "zero-copy-send", "postcopy-preempt", + "switchover-ack", ); =20 =20 @@ -138,7 +139,7 @@ struct _qemuMigrationParamsAlwaysOnItem { typedef struct _qemuMigrationParamsFlagMapItem qemuMigrationParamsFlagMapI= tem; struct _qemuMigrationParamsFlagMapItem { /* Describes what to do with the capability if @flag is found. - * When se to QEMU_MIGRATION_FLAG_REQUIRED, the capability will be + * When set to QEMU_MIGRATION_FLAG_REQUIRED, the capability will be * enabled iff the specified migration flag is enabled. On the other h= and * QEMU_MIGRATION_FLAG_FORBIDDEN will enable the capability as long as * the specified migration flag is not enabled. */ @@ -215,6 +216,11 @@ static const qemuMigrationParamsFlagMapItem qemuMigrat= ionParamsFlagMap[] =3D { .flag =3D VIR_MIGRATE_ZEROCOPY, .cap =3D QEMU_MIGRATION_CAP_ZERO_COPY_SEND, .party =3D QEMU_MIGRATION_SOURCE}, + + {.match =3D QEMU_MIGRATION_FLAG_FORBIDDEN, + .flag =3D VIR_MIGRATE_TUNNELLED, + .cap =3D QEMU_MIGRATION_CAP_SWITCHOVER_ACK, + .party =3D QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION}, }; =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 91bc6792cd..df67f1fb92 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -41,6 +41,7 @@ typedef enum { QEMU_MIGRATION_CAP_RETURN_PATH, QEMU_MIGRATION_CAP_ZERO_COPY_SEND, QEMU_MIGRATION_CAP_POSTCOPY_PREEMPT, + QEMU_MIGRATION_CAP_SWITCHOVER_ACK, =20 QEMU_MIGRATION_CAP_LAST } qemuMigrationCapability; --=20 2.43.0