render / rpms / libvirt

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