From: Yang Hongyang Date: Wed, 2 Jul 2014 08:09:11 +0000 (+0800) Subject: remus: make postcopy callback asynchronous X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4720 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cbe8115b6b1cc8a3a886de61ac3f690caad720c9;p=xen.git remus: make postcopy callback asynchronous Make postcopy callback asynchronous. This is a prepare patch of the following patch series. Signed-off-by: Yang Hongyang Acked-by: Ian Jackson --- diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 0448d1723f..83eb29a374 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -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 -----*/ diff --git a/tools/libxl/libxl_save_msgs_gen.pl b/tools/libxl/libxl_save_msgs_gen.pl index 88f49211f9..6b4b65e94b 100755 --- a/tools/libxl/libxl_save_msgs_gen.pl +++ b/tools/libxl/libxl_save_msgs_gen.pl @@ -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)] ],