From 6eb9ddda17ffa9c72ce21b64aa8e1694055f6733 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 4 Dec 2009 07:11:06 +0000 Subject: [PATCH] libxenlight: domain resume Added libxenlight implementation for resume domain. This brings back a cooperative pv domain from the shutdown state after save, enabling checkpointing. Signed-off-by: Andres Lagar-Cavilla --- tools/libxl/libxl.c | 22 ++++++++++++++++++++++ tools/libxl/libxl.h | 1 + 2 files changed, 23 insertions(+) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 0f53dda012..7a01dc5df1 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -264,6 +264,28 @@ int libxl_domain_restore(struct libxl_ctx *ctx, libxl_domain_build_info *info, return 0; } +int libxl_domain_resume(struct libxl_ctx *ctx, uint32_t domid) +{ + if (is_hvm(ctx, domid)) { + XL_LOG(ctx, XL_LOG_DEBUG, "Called domain_resume on " + "non-cooperative hvm domain %u", domid); + return ERROR_NI; + } + if (xc_domain_resume(ctx->xch, domid, 1)) { + XL_LOG_ERRNO(ctx, XL_LOG_ERROR, + "xc_domain_resume failed for domain %u", + domid); + return ERROR_FAIL; + } + if (!xs_resume_domain(ctx->xsh, domid)) { + XL_LOG_ERRNO(ctx, XL_LOG_ERROR, + "xs_resume_domain failed for domain %u", + domid); + return ERROR_FAIL; + } + return 0; +} + struct libxl_dominfo * libxl_domain_list(struct libxl_ctx *ctx, int *nb_domain) { struct libxl_dominfo *ptr; diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 794d1f3384..a07918520f 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -262,6 +262,7 @@ int libxl_domain_restore(struct libxl_ctx *ctx, libxl_domain_build_info *info, libxl_device_model_info *dm_info); int libxl_domain_suspend(struct libxl_ctx *ctx, libxl_domain_suspend_info *info, uint32_t domid, int fd); +int libxl_domain_resume(struct libxl_ctx *ctx, uint32_t domid); int libxl_domain_shutdown(struct libxl_ctx *ctx, uint32_t domid, int req); int libxl_domain_destroy(struct libxl_ctx *ctx, uint32_t domid, int force); -- 2.30.2