render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
032100
From c50cae68f0d083ad0c5ffcf85908cc62eeaa866d Mon Sep 17 00:00:00 2001
032100
Message-Id: <c50cae68f0d083ad0c5ffcf85908cc62eeaa866d@dist-git>
032100
From: Jiri Denemark <jdenemar@redhat.com>
032100
Date: Tue, 19 Jul 2022 13:48:44 +0200
032100
Subject: [PATCH] qemu_migration: Store original migration params in status XML
032100
032100
We keep original values of migration parameters so that we can restore
032100
them at the end of migration to make sure later migration does not use
032100
some random values. However, this does not really work when libvirt
032100
daemon is restarted on the source host because we failed to explicitly
032100
save the status XML after getting the migration parameters from QEMU.
032100
Actually it might work if the status XML is written later for some other
032100
reason such as domain state change, but that's not how it should work.
032100
032100
https://bugzilla.redhat.com/show_bug.cgi?id=2107892
032100
032100
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
032100
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
032100
(cherry picked from commit c7238941357f0d2e94524cf8c5ad7d9c82dcf2f9)
032100
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
032100
---
032100
 src/qemu/qemu_migration.c | 6 ++++++
032100
 1 file changed, 6 insertions(+)
032100
032100
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
032100
index 8a2f5b09a1..9289df81eb 100644
032100
--- a/src/qemu/qemu_migration.c
032100
+++ b/src/qemu/qemu_migration.c
032100
@@ -3245,6 +3245,9 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
032100
                                  migParams, mig->caps->automatic) < 0)
032100
         goto error;
032100
 
032100
+    /* Save original migration parameters */
032100
+    qemuDomainSaveStatus(vm);
032100
+
032100
     /* Migrations using TLS need to add the "tls-creds-x509" object and
032100
      * set the migration TLS parameters */
032100
     if (flags & VIR_MIGRATE_TLS) {
032100
@@ -4822,6 +4825,9 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
032100
                                  migParams, mig->caps->automatic) < 0)
032100
         goto error;
032100
 
032100
+    /* Save original migration parameters */
032100
+    qemuDomainSaveStatus(vm);
032100
+
032100
     if (flags & VIR_MIGRATE_TLS) {
032100
         const char *hostname = NULL;
032100
 
032100
-- 
032100
2.35.1
032100