render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c1c534
From e41b2f83ca98fe352e9901d99b5cb9bf62d79845 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <e41b2f83ca98fe352e9901d99b5cb9bf62d79845@dist-git>
c1c534
From: Jiri Denemark <jdenemar@redhat.com>
c1c534
Date: Fri, 19 Jan 2018 14:33:16 +0100
c1c534
Subject: [PATCH] qemu: Fix crash in offline migration
c1c534
c1c534
When migrating a shutoff domain (i.e., offline migration), we have no
c1c534
statistics to report and thus jobInfo will be NULL in
c1c534
qemuMigrationFinish.
c1c534
c1c534
Broken by me in v3.10.0-183-ge8784e7868.
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1536351
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
c1c534
(cherry picked from commit bcc5710708ec90146b71bdb00d8705cb4a9e0088)
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/qemu/qemu_migration.c | 6 ++++--
c1c534
 1 file changed, 4 insertions(+), 2 deletions(-)
c1c534
c1c534
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
c1c534
index b814cc6608..a50bb7206c 100644
c1c534
--- a/src/qemu/qemu_migration.c
c1c534
+++ b/src/qemu/qemu_migration.c
c1c534
@@ -5459,8 +5459,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
c1c534
     }
c1c534
 
c1c534
     if (dom) {
c1c534
-        VIR_STEAL_PTR(priv->job.completed, jobInfo);
c1c534
-        priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
c1c534
+        if (jobInfo) {
c1c534
+            VIR_STEAL_PTR(priv->job.completed, jobInfo);
c1c534
+            priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
c1c534
+        }
c1c534
 
c1c534
         if (qemuMigrationBakeCookie(mig, driver, vm, cookieout, cookieoutlen,
c1c534
                                     QEMU_MIGRATION_COOKIE_STATS) < 0)
c1c534
-- 
c1c534
2.16.1
c1c534