]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_migration_cookie: Make cookie parsing robust against missing domain job
authorPeter Krempa <pkrempa@redhat.com>
Fri, 30 Oct 2020 15:14:00 +0000 (16:14 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 Nov 2020 11:25:49 +0000 (12:25 +0100)
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 <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_migration_cookie.c

index be676269b8d8d09819c5de14c83ba026a8cc2ce5..6f2b1b2f57c13f324fb36675d8d0457ae72d6e33 100644 (file)
@@ -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);