diff options
author | Bastian Blank <waldi@debian.org> | 2012-09-25 11:03:51 +0100 |
---|---|---|
committer | Bastian Blank <waldi@debian.org> | 2012-09-25 11:03:51 +0100 |
commit | 95393dde94267faa1525f6a1a27c6e47fc0fec59 (patch) | |
tree | 37d99620690f052c608c1b469e6450fe29cbc6cf /tools | |
parent | c474b173ae8883c6beb2b8ea90694d594a5b1677 (diff) | |
download | xen-95393dde94267faa1525f6a1a27c6e47fc0fec59.tar.gz xen-95393dde94267faa1525f6a1a27c6e47fc0fec59.tar.bz2 xen-95393dde94267faa1525f6a1a27c6e47fc0fec59.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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxl/xl_cmdimpl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 1627cacfe3..1d77bb4c50 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -2992,15 +2992,18 @@ static int save_domain(uint32_t domid, 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, |