From: Jiri Denemark Date: Wed, 30 Nov 2022 13:29:55 +0000 (+0100) Subject: qemu: Pass vm to qemuMigrationCookieParse if it exists X-Git-Tag: v8.10.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af59c944bb36f11996d03069116df2f14d7a8136;p=thirdparty%2Flibvirt.git qemu: Pass vm to qemuMigrationCookieParse if it exists The vm object is used inside qemuMigrationCookieParse based on the flags passed to qemuMigrationCookieParse and the content of the cookie. The callers should not just blindly guess and pass NULL if they (incorrectly) think the vm object is not needed. We should always pass the vm object unless it does not exist yet. This fixes a bug when statistics of a completed migration reported "Unknown" operation instead of "Incoming migration" on the destination host. https://bugzilla.redhat.com/show_bug.cgi?id=2137298 Fixes: v8.7.0-79-g0150f7a8c1 Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index bef06f4caf..6d3810c79c 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4775,7 +4775,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, QEMU_MIGRATION_COOKIE_GRAPHICS | QEMU_MIGRATION_COOKIE_CAPS | QEMU_MIGRATION_COOKIE_BLOCK_DIRTY_BITMAPS, - NULL); + vm); if (!mig) goto error; @@ -6459,7 +6459,7 @@ qemuMigrationDstFinishOffline(virQEMUDriver *driver, g_autoptr(qemuMigrationCookie) mig = NULL; if (!(mig = qemuMigrationCookieParse(driver, vm->def, priv->origname, priv, - cookiein, cookieinlen, cookie_flags, NULL))) + cookiein, cookieinlen, cookie_flags, vm))) return NULL; if (qemuMigrationDstPersist(driver, vm, mig, false) < 0) @@ -6655,7 +6655,7 @@ qemuMigrationDstFinishActive(virQEMUDriver *driver, vm, flags, retcode); if (!(mig = qemuMigrationCookieParse(driver, vm->def, priv->origname, priv, - cookiein, cookieinlen, cookie_flags, NULL))) + cookiein, cookieinlen, cookie_flags, vm))) goto error; if (retcode != 0) {