From: Andrew Panyakin Date: Tue, 7 Apr 2020 14:52:22 +0000 (+0000) Subject: libxc/migration: Abort migration on precopy policy request X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~417 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=69f741347d9718b470fe29c012b7a2622249b709;p=xen.git libxc/migration: Abort migration on precopy policy request 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 Acked-by: Wei Liu [wei: fix coding style issue] --- diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c index fa736a311f..6ba6623ff3 100644 --- a/tools/libxc/xc_sr_save.c +++ b/tools/libxc/xc_sr_save.c @@ -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);