76daa3
From b735f14ca7fe2adb349d95e7f79c22e794e14b5b Mon Sep 17 00:00:00 2001
76daa3
From: Kevin Wolf <kwolf@redhat.com>
76daa3
Date: Fri, 19 May 2017 09:38:58 +0200
76daa3
Subject: [PATCH 23/27] migration: Call blk_resume_after_migration() for
76daa3
 postcopy
76daa3
76daa3
RH-Author: Kevin Wolf <kwolf@redhat.com>
76daa3
Message-id: <1495186739-13659-2-git-send-email-kwolf@redhat.com>
76daa3
Patchwork-id: 75375
76daa3
O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 1/2] migration: Call blk_resume_after_migration() for postcopy
76daa3
Bugzilla: 1452148
76daa3
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
76daa3
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
76daa3
RH-Acked-by: Max Reitz <mreitz@redhat.com>
76daa3
76daa3
Commit d35ff5e6 ('block: Ignore guest dev permissions during incoming
76daa3
migration') added blk_resume_after_migration() to the precopy migration
76daa3
path, but neglected to add it to the duplicated code that is used for
76daa3
postcopy migration. This means that the guest device doesn't request the
76daa3
necessary permissions, which ultimately led to failing assertions.
76daa3
76daa3
Add the missing blk_resume_after_migration() to the postcopy path.
76daa3
76daa3
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
76daa3
Reviewed-by: Eric Blake <eblake@redhat.com>
76daa3
(cherry picked from commit 0042fd3663662c848aaff5c65b6880e545d94b18)
76daa3
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
76daa3
---
76daa3
 migration/savevm.c | 8 ++++++++
76daa3
 1 file changed, 8 insertions(+)
76daa3
76daa3
diff --git a/migration/savevm.c b/migration/savevm.c
76daa3
index 8e05383..21d7985 100644
76daa3
--- a/migration/savevm.c
76daa3
+++ b/migration/savevm.c
76daa3
@@ -1626,6 +1626,14 @@ static void loadvm_postcopy_handle_run_bh(void *opaque)
76daa3
         error_report_err(local_err);
76daa3
     }
76daa3
 
76daa3
+    /* If we get an error here, just don't restart the VM yet. */
76daa3
+    blk_resume_after_migration(&local_err);
76daa3
+    if (local_err) {
76daa3
+        error_free(local_err);
76daa3
+        local_err = NULL;
76daa3
+        autostart = false;
76daa3
+    }
76daa3
+
76daa3
     trace_loadvm_postcopy_handle_run_cpu_sync();
76daa3
     cpu_synchronize_all_post_init();
76daa3
 
76daa3
-- 
76daa3
1.8.3.1
76daa3