File b9eeeebd-libxl-support-MIGRATE_CHANGE_PROTECTION.patch of Package libvirt.29828

From 9e23995fc1d1a7175455fcde28e2f59d8c446f01 Mon Sep 17 00:00:00 2001
From: Jim Fehlig <jfehlig@suse.com>
Date: Wed, 12 Jul 2023 15:15:08 -0600
Subject: [PATCH 2/2] libxl: Advertise support for
 VIR_MIGRATE_CHANGE_PROTECTION
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The libxl driver has basic support for VIR_MIGRATE_CHANGE_PROTECTION
by starting and stopping modify jobs in the begin/confirm and prepare/finish
phases of migration, but it doesn't advertise that support. This can result
in unterminated jobs because the migration logic skips phases of migration
when the VIR_MIGRATE_CHANGE_PROTECTION feature is absent. Ensure jobs are
terminated properly by advertising support for VIR_MIGRATE_CHANGE_PROTECTION.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit b9eeeebddb236dc8c778fd059073ca1db0ed364b)
---
 src/libxl/libxl_driver.c    | 2 +-
 src/libxl/libxl_migration.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Index: libvirt-9.0.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-9.0.0.orig/src/libxl/libxl_driver.c
+++ libvirt-9.0.0/src/libxl/libxl_driver.c
@@ -5707,8 +5707,8 @@ libxlConnectSupportsFeature(virConnectPt
     case VIR_DRV_FEATURE_MIGRATION_V3:
     case VIR_DRV_FEATURE_MIGRATION_PARAMS:
     case VIR_DRV_FEATURE_MIGRATION_P2P:
-        return 1;
     case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
+        return 1;
     case VIR_DRV_FEATURE_MIGRATION_DIRECT:
     case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
     case VIR_DRV_FEATURE_MIGRATION_V1:
Index: libvirt-9.0.0/src/libxl/libxl_migration.h
===================================================================
--- libvirt-9.0.0.orig/src/libxl/libxl_migration.h
+++ libvirt-9.0.0/src/libxl/libxl_migration.h
@@ -28,7 +28,8 @@
      VIR_MIGRATE_TUNNELLED | \
      VIR_MIGRATE_PERSIST_DEST | \
      VIR_MIGRATE_UNDEFINE_SOURCE | \
-     VIR_MIGRATE_PAUSED)
+     VIR_MIGRATE_PAUSED | \
+     VIR_MIGRATE_CHANGE_PROTECTION)
 
 /* All supported migration parameters and their types. */
 #define LIBXL_MIGRATION_PARAMETERS \
openSUSE Build Service is sponsored by