From: Yang Hongyang Date: Fri, 10 Jul 2015 07:11:38 +0000 (+0800) Subject: libxl/remus: introduce libxl__remus_teardown X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2748 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c3e886a1bb6341fb1cea2e696c8fd7e02992bace;p=xen.git libxl/remus: introduce libxl__remus_teardown introduce libxl__remus_teardown to teardown Remus devices. Signed-off-by: Yang Hongyang CC: Ian Campbell CC: Ian Jackson CC: Wei Liu Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 36286412b9..601d5cc7c1 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -1868,6 +1868,9 @@ static void save_device_model_datacopier_done(libxl__egc *egc, dss->save_dm_callback(egc, dss, our_rc); } +static void libxl__remus_teardown(libxl__egc *egc, + libxl__domain_suspend_state *dss, + int rc); static void remus_teardown_done(libxl__egc *egc, libxl__remus_devices_state *rds, int rc); @@ -1886,17 +1889,26 @@ static void domain_save_done(libxl__egc *egc, xc_suspend_evtchn_release(CTX->xch, CTX->xce, domid, dss->guest_evtchn.port, &dss->guest_evtchn_lockfd); - if (!dss->remus) { - dss->callback(egc, dss, rc); + if (dss->remus) { + /* + * With Remus, if we reach this point, it means either + * backup died or some network error occurred preventing us + * from sending checkpoints. Teardown the network buffers and + * release netlink resources. This is an async op. + */ + libxl__remus_teardown(egc, dss, rc); return; } - /* - * With Remus, if we reach this point, it means either - * backup died or some network error occurred preventing us - * from sending checkpoints. Teardown the network buffers and - * release netlink resources. This is an async op. - */ + dss->callback(egc, dss, rc); +} + +static void libxl__remus_teardown(libxl__egc *egc, + libxl__domain_suspend_state *dss, + int rc) +{ + EGC_GC; + LOG(WARN, "Remus: Domain suspend terminated with rc %d," " teardown Remus devices...", rc); dss->rds.callback = remus_teardown_done;