Blob Blame History Raw
From b735f14ca7fe2adb349d95e7f79c22e794e14b5b Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Fri, 19 May 2017 09:38:58 +0200
Subject: [PATCH 23/27] migration: Call blk_resume_after_migration() for
 postcopy

RH-Author: Kevin Wolf <kwolf@redhat.com>
Message-id: <1495186739-13659-2-git-send-email-kwolf@redhat.com>
Patchwork-id: 75375
O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 1/2] migration: Call blk_resume_after_migration() for postcopy
Bugzilla: 1452148
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>

Commit d35ff5e6 ('block: Ignore guest dev permissions during incoming
migration') added blk_resume_after_migration() to the precopy migration
path, but neglected to add it to the duplicated code that is used for
postcopy migration. This means that the guest device doesn't request the
necessary permissions, which ultimately led to failing assertions.

Add the missing blk_resume_after_migration() to the postcopy path.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 0042fd3663662c848aaff5c65b6880e545d94b18)
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 migration/savevm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/migration/savevm.c b/migration/savevm.c
index 8e05383..21d7985 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1626,6 +1626,14 @@ static void loadvm_postcopy_handle_run_bh(void *opaque)
         error_report_err(local_err);
     }
 
+    /* If we get an error here, just don't restart the VM yet. */
+    blk_resume_after_migration(&local_err);
+    if (local_err) {
+        error_free(local_err);
+        local_err = NULL;
+        autostart = false;
+    }
+
     trace_loadvm_postcopy_handle_run_cpu_sync();
     cpu_synchronize_all_post_init();
 
-- 
1.8.3.1