From a18a73d7472e6ff5bc1e5f7fb9f7a42464295d03 Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Tue, 10 Apr 2018 15:28:42 +0100
Subject: [PATCH] Revert "migration: Don't activate block devices if using -S"

This reverts commit 0746a92612276aee69e66dfe6782b0f882d221d5.
Discussion with kwolf suggests this is actually an API change that
we need to gate on a capability.  Push to 2.13.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/migration.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 58bd3827301..52a5092add6 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -306,21 +306,13 @@ static void process_incoming_migration_bh(void *opaque)
     Error *local_err = NULL;
     MigrationIncomingState *mis = opaque;
 
-    /* Only fire up the block code now if we're going to restart the
-     * VM, else 'cont' will do it.
-     * This causes file locking to happen; so we don't want it to happen
-     * unless we really are starting the VM.
-     */
-    if (autostart && (!global_state_received() ||
-        global_state_get_runstate() == RUN_STATE_RUNNING)) {
-        /* Make sure all file formats flush their mutable metadata.
-         * If we get an error here, just don't restart the VM yet. */
-        bdrv_invalidate_cache_all(&local_err);
-        if (local_err) {
-            error_report_err(local_err);
-            local_err = NULL;
-            autostart = false;
-        }
+    /* Make sure all file formats flush their mutable metadata.
+     * If we get an error here, just don't restart the VM yet. */
+    bdrv_invalidate_cache_all(&local_err);
+    if (local_err) {
+        error_report_err(local_err);
+        local_err = NULL;
+        autostart = false;
     }
 
     /*
-- 
GitLab