From f8b0866878f17e97b7c0d7b178cb4b81a01b6807 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 30 Oct 2020 16:14:00 +0100 Subject: [PATCH] qemu_migration_cookie: Make cookie parsing robust against missing domain job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/qemu/qemu_migration_cookie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);