[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 11/35] libxl_domain: Convert libxl_domain_resume to use libxl__domain_resume



Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_domain.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c
index 80797c5ed21c..d78ffa6b6019 100644
--- a/tools/libxl/libxl_domain.c
+++ b/tools/libxl/libxl_domain.c
@@ -174,15 +174,32 @@ int libxl_domain_rename(libxl_ctx *ctx, uint32_t domid,
     return rc;
 }
 
+static void domain_resume_done(libxl__egc *egc,
+                               libxl__dm_resume_state *,
+                               int rc);
+
 int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid, int suspend_cancel,
                         const libxl_asyncop_how *ao_how)
 {
     AO_CREATE(ctx, domid, ao_how);
-    int rc = libxl__domain_resume_deprecated(gc, domid, suspend_cancel);
-    libxl__ao_complete(egc, ao, rc);
+    libxl__dm_resume_state *dmrs;
+
+    GCNEW(dmrs);
+    dmrs->ao = ao;
+    dmrs->domid = domid;
+    dmrs->callback = domain_resume_done;
+    libxl__domain_resume(egc, dmrs, suspend_cancel);
     return AO_INPROGRESS;
 }
 
+static void domain_resume_done(libxl__egc *egc,
+                               libxl__dm_resume_state *dmrs,
+                               int rc)
+{
+    STATE_AO_GC(dmrs->ao);
+    libxl__ao_complete(egc, ao, rc);
+}
+
 /*
  * Preserves a domain but rewrites xenstore etc to make it unique so
  * that the domain can be restarted.
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.