From: Peter Krempa Date: Fri, 30 Oct 2020 15:14:00 +0000 (+0100) Subject: qemu_migration_cookie: Make cookie parsing robust against missing domain job X-Git-Tag: v6.10.0-rc1~297 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8b0866878f17e97b7c0d7b178cb4b81a01b6807;p=thirdparty%2Flibvirt.git qemu_migration_cookie: Make cookie parsing robust against missing domain job In testing code we don't properly populate the job sometimes. If it isn't populated we should not touch it though in the migration cookie code. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index be676269b8..6f2b1b2f57 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -1429,7 +1429,7 @@ qemuMigrationCookieParse(virQEMUDriverPtr driver, } } - if (flags & QEMU_MIGRATION_COOKIE_STATS && mig->jobInfo) + if (flags & QEMU_MIGRATION_COOKIE_STATS && mig->jobInfo && priv->job.current) mig->jobInfo->operation = priv->job.current->operation; return g_steal_pointer(&mig);