]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_migration: Store original migration params in status XML
authorJiri Denemark <jdenemar@redhat.com>
Tue, 19 Jul 2022 11:48:44 +0000 (13:48 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 26 Jul 2022 08:09:00 +0000 (10:09 +0200)
We keep original values of migration parameters so that we can restore
them at the end of migration to make sure later migration does not use
some random values. However, this does not really work when libvirt
daemon is restarted on the source host because we failed to explicitly
save the status XML after getting the migration parameters from QEMU.
Actually it might work if the status XML is written later for some other
reason such as domain state change, but that's not how it should work.

https://bugzilla.redhat.com/show_bug.cgi?id=2107892

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_migration.c

index be5fc455f94a072af09c2f3b6b2a33cacb2f06d8..8e9428a5bbb61d1517d19efd3d5057695581c561 100644 (file)
@@ -3245,6 +3245,9 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
                                  migParams, mig->caps->automatic) < 0)
         goto error;
 
+    /* Save original migration parameters */
+    qemuDomainSaveStatus(vm);
+
     /* Migrations using TLS need to add the "tls-creds-x509" object and
      * set the migration TLS parameters */
     if (flags & VIR_MIGRATE_TLS) {
@@ -4821,6 +4824,9 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
                                  migParams, mig->caps->automatic) < 0)
         goto error;
 
+    /* Save original migration parameters */
+    qemuDomainSaveStatus(vm);
+
     if (flags & VIR_MIGRATE_TLS) {
         const char *hostname = NULL;