libxc/migration: Abort migration on precopy policy request
authorAndrew Panyakin <apanyaki@amazon.com>
Tue, 7 Apr 2020 14:52:22 +0000 (14:52 +0000)
committerWei Liu <wl@xen.org>
Thu, 9 Apr 2020 14:43:18 +0000 (15:43 +0100)
libxc defines XGS_POLICY_ABORT for precopy policy to signal that migration
should be aborted (eg. if the estimated pause time is too huge for the
instance). Default simple precopy policy never returns that, but it could be
overriden with a custom one.

Signed-off-by: Andrew Panyakin <apanyaki@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
[wei: fix coding style issue]

tools/libxc/xc_sr_save.c

index fa736a311fafe01a7d6c1f506675fc2763fa1a9b..6ba6623ff33234607a7b00087c4bc24838c3d2cf 100644 (file)
@@ -560,6 +560,13 @@ static int send_memory_live(struct xc_sr_context *ctx)
 
     }
 
+    if ( policy_decision == XGS_POLICY_ABORT )
+    {
+        PERROR("Abort precopy loop");
+        rc = -1;
+        goto out;
+    }
+
  out:
     xc_set_progress_prefix(xch, NULL);
     free(progress_str);