]> xenbits.xensource.com Git - xen.git/commitdiff
remus: make postcopy callback asynchronous
authorYang Hongyang <yanghy@cn.fujitsu.com>
Wed, 2 Jul 2014 08:09:11 +0000 (16:09 +0800)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 3 Jul 2014 09:49:29 +0000 (10:49 +0100)
Make postcopy callback asynchronous.
This is a prepare patch of the following patch series.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_dom.c
tools/libxl/libxl_save_msgs_gen.pl

index 0448d1723f7b7fd9f8c871b85f37680b1f6bfecd..83eb29a374ee42bc54b102c4b74111ad7147070a 100644 (file)
@@ -1479,18 +1479,22 @@ static void remus_domain_suspend_callback_common_done(libxl__egc *egc,
     libxl__xc_domain_saverestore_async_callback_done(egc, &dss->shs, ok);
 }
 
-static int libxl__remus_domain_resume_callback(void *data)
+static void libxl__remus_domain_resume_callback(void *data)
 {
+    int ok = 0;
     libxl__save_helper_state *shs = data;
+    libxl__egc *egc = shs->egc;
     libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss, shs);
     STATE_AO_GC(dss->ao);
 
     /* Resumes the domain and the device model */
     if (libxl__domain_resume(gc, dss->domid, /* Fast Suspend */1))
-        return 0;
+        goto out;
 
     /* REMUS TODO: Deal with disk. Start a new network output buffer */
-    return 1;
+    ok = 1;
+out:
+    libxl__xc_domain_saverestore_async_callback_done(egc, shs, ok);
 }
 
 /*----- remus asynchronous checkpoint callback -----*/
index 88f49211f92a30646d3eafd4553a44059762b12b..6b4b65e94b74398366a84834d311923770dab729 100755 (executable)
@@ -24,7 +24,7 @@ our @msgs = (
                                                 'unsigned long', 'done',
                                                 'unsigned long', 'total'] ],
     [  3, 'scxA',   "suspend", [] ],
-    [  4, 'scxW',   "postcopy", [] ],
+    [  4, 'scxA',   "postcopy", [] ],
     [  5, 'scxA',   "checkpoint", [] ],
     [  6, 'scxA',   "switch_qemu_logdirty",  [qw(int domid
                                               unsigned enable)] ],