libxl: do slow resume after failed migration attempt
PATCH 1/1 libxl: do slow resume after failed migration attempt
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1297856874 0
# Node ID 1728ed4bbec9e82ca13c2639c8e4ef8b4dc231b6 # Parent aa466613328f5de78fdfc968473cb06e948c1f5d
libxl: do slow resume after failed migration attempt
both of the current callers for libxl_domain_resume are calling after a migration has failed, one is failure to suspend on the sender and the other is failure to start on the destination, both leading to a resume attempt on the sender.
However in the first case, failure to suspend, there is no guarantee that the guest has made it as far as the suspend hypercall and therefore the fast resume method, which frobs the hypercall return to indicate a cancelled suspend, cannot safely be used since it will corrupt %eax/%rax.
For the second case, failure to start on destination, I don't think it really matters if the resume is fast or slow.
Therefore always use the slow/uncooperative version of xc_domain_resume from libxl_domain_resume.
This makes a PV domain which failed to suspend (e.g. because the core Linux PM infrastructure within the guest didn't allow it) recover gracefully.
tools/libxl/libxl.c +1 -1
@@ -226,7 +226,7 @@ int libxl_domain_resume(libxl_ctx *ctx, rc =ERROR_NI ; goto out; } -if (xc_domain_resume (ctx->xch, domid,1 )) { +if (xc_domain_resume (ctx->xch, domid,0 )) {LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"xc_domain_resume failed for domain %u" , domid);
Quoted 21 lines · Ian Campbell
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1297856874 0
# Node ID1728ed4bbec9e82ca13c2639c8e4ef8b4dc231b6# Parentaa466613328f5de78fdfc968473cb06e948c1f5d
libxl: do slow resume after failed migration attemptboth of the current callers for
libxl_domain_resumeare calling after a migration has failed, one is failure to suspend on the sender and the other is failure to start on the destination, both leading to a resume attempt on the sender.However in the first case, failure to suspend, there is no guarantee that the guest has made it as far as the suspend hypercall and therefore the fast resume method, which frobs the hypercall return to indicate a cancelled suspend, cannot safely be used since it will corrupt %eax/%rax.
For the second case, failure to start on destination, I don't think it really matters if the resume is fast or slow.
Quoted 6 lines
Therefore always use the slow/uncooperative version of
xc_domain_resumefromlibxl_domain_resume.This makes a PV domain which failed to suspend (e.g. because the core Linux PM infrastructure within the guest didn't allow it) recover gracefully.
a PVHVM domain never suffered from this because libxl_domain_resume bails due to a libxl__domain_is_hvm check. I'm not 100% clear whether this is correct but I didn't change it. My test with a PVHVM guest which acknowledges the suspend but doesn't go on to do anything seems to work.
Ian.
Quoted 15 lines
Signed-off-by Ian Campbell <[email protected]>diff -r
aa466613328f-r1728ed4bbec9tools/libxl/libxl.ctools/libxl/libxl.c +1
-1@@ -226,7 +226,7 @@ int libxl_domain_resume(libxl_ctx *ctx, rc =ERROR_NI ; goto out; } -if (xc_domain_resume (ctx->xch, domid,1 )) { +if (xc_domain_resume (ctx->xch, domid,0 )) {LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"xc_domain_resume failed for domain %u" , domid);
Quoted 25 lines · Ian Campbell
Quoted 24 lines · Ian Campbell
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1297856874 0
# Node ID1728ed4bbec9e82ca13c2639c8e4ef8b4dc231b6# Parentaa466613328f5de78fdfc968473cb06e948c1f5d
libxl: do slow resume after failed migration attemptboth of the current callers for
libxl_domain_resumeare calling after a migration has failed, one is failure to suspend on the sender and the other is failure to start on the destination, both leading to a resume attempt on the sender.However in the first case, failure to suspend, there is no guarantee that the guest has made it as far as the suspend hypercall and therefore the fast resume method, which frobs the hypercall return to indicate a cancelled suspend, cannot safely be used since it will corrupt %eax/%rax.
For the second case, failure to start on destination, I don't think it really matters if the resume is fast or slow.
Therefore always use the slow/uncooperative version of
xc_domain_resumefromlibxl_domain_resume.
Quoted 8 lines
Quoted 3 lines
This makes a PV domain which failed to suspend (e.g. because the core Linux PM infrastructure within the guest didn't allow it) recover gracefully.
a PVHVM domain never suffered from this because
libxl_domain_resumebails due to alibxl__domain_is_hvmcheck. I'm not 100% clear whether this is correct but I didn't change it. My test with a PVHVM guest which acknowledges the suspend but doesn't go on to do anything seems to work.
Looking closer, even a PV guest which is hacked to not actually try to suspend fails this new xc_domain_resume call and it's actually the original domain which continues.
I'm inclined to suggest that this is OK and that trying to do a slow xc_domain_resume will save guests which have suffered certain types of failure and be harmless for other types of failures, but I wouldn't argue strongly against a suggestion that the right thing to do in the "failed to suspend" case is to simply unpause the original domain and let it try and continue...
Ian.
Quoted 25 lines
Ian.
Quoted 7 lines
Signed-off-by Ian Campbell <[email protected]>diff -r
aa466613328f-r1728ed4bbec9tools/libxl/libxl.ctools/libxl/libxl.c int libxl_domain_resume(libxl_ctx *ctx, · line 232
Quoted 8 lines
tools/libxl/libxl.c +1
-1@@ -226,7 +226,7 @@ int libxl_domain_resume(libxl_ctx *ctx, rc =ERROR_NI ; goto out; } -if (xc_domain_resume (ctx->xch, domid,1 )) { +if (xc_domain_resume (ctx->xch, domid,0 )) {LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"xc_domain_resume failed for domain %u" , domid);_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ian Campbell writes ("Re: [Xen-devel] Re: [PATCH] libxl: do slow resume after failed migration attempt"):
Quoted 6 lines
I'm inclined to suggest that this is OK and that trying to do a slow
xc_domain_resumewill save guests which have suffered certain types of failure and be harmless for other types of failures, but I wouldn't argue strongly against a suggestion that the right thing to do in the "failed to suspend" case is to simply unpause the original domain and let it try and continue...
I find this all quite convincing. I have applied the patch.
Thanks,
Ian.