From: Jiri Denemark Date: Tue, 19 Jul 2022 11:48:44 +0000 (+0200) Subject: qemu_migration: Store original migration params in status XML X-Git-Tag: v8.6.0-rc1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7238941357f0d2e94524cf8c5ad7d9c82dcf2f9;p=thirdparty%2Flibvirt.git qemu_migration: Store original migration params in status XML 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 Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index be5fc455f9..8e9428a5bb 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -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;