aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastian Blank <waldi@debian.org>2012-10-26 16:42:10 +0100
committerBastian Blank <waldi@debian.org>2012-10-26 16:42:10 +0100
commita0fe46bdedff9b7175cdedad1ee29451d4105d35 (patch)
treecd8594947c411df18a51cb5ba88825060b3177bd
parentce880ad8cc2d38abfdc288ecbf44220506507898 (diff)
downloadxen-a0fe46bdedff9b7175cdedad1ee29451d4105d35.tar.gz
xen-a0fe46bdedff9b7175cdedad1ee29451d4105d35.tar.bz2
xen-a0fe46bdedff9b7175cdedad1ee29451d4105d35.zip
xl: resume the domain on suspend failure
The MUST macro calls exit(3) on failure but we need to cleanup and resume. Signed-off-by: Bastian Blank <waldi@debian.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com> xen-unstable changeset: 25942:16ee1d300cfd Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--tools/libxl/xl_cmdimpl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5b59dd0847..c997015383 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2997,15 +2997,18 @@ static int save_domain(const char *p, const char *filename, int checkpoint,
save_domain_core_writeconfig(fd, filename, config_data, config_len);
- MUST(libxl_domain_suspend(ctx, domid, fd, 0, NULL));
+ int rc = libxl_domain_suspend(ctx, domid, fd, 0, NULL);
close(fd);
- if (checkpoint)
+ if (rc < 0)
+ fprintf(stderr, "Failed to save domain, resuming domain\n");
+
+ if (checkpoint || rc < 0)
libxl_domain_resume(ctx, domid, 1, 0);
else
libxl_domain_destroy(ctx, domid, 0);
- exit(0);
+ exit(rc < 0 ? 1 : 0);
}
static pid_t create_migration_child(const char *rune, int *send_fd,