aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_save_callout.c
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2012-06-28 18:43:23 +0100
committerIan Jackson <ian.jackson@eu.citrix.com>2012-06-28 18:43:23 +0100
commit0d176cc71600d74b2bd7dcb437ce4ce8c0033275 (patch)
tree000838c166c010ccd058f3b83c8d5e8922758c31 /tools/libxl/libxl_save_callout.c
parent68c6062f0cbfd61dbf8839a1b721ea3c00072f26 (diff)
downloadxen-0d176cc71600d74b2bd7dcb437ce4ce8c0033275.tar.gz
xen-0d176cc71600d74b2bd7dcb437ce4ce8c0033275.tar.bz2
xen-0d176cc71600d74b2bd7dcb437ce4ce8c0033275.zip
libxl: wait for qemu to acknowledge logdirty command
The current migration code in libxl instructs qemu to start or stop logdirty, but it does not wait for an acknowledgement from qemu before continuing. This might lead to memory corruption (!) Fix this by waiting for qemu to acknowledge the command. Unfortunately the necessary ao arrangements for waiting for this command are unique because qemu has a special protocol for this particular operation. Also, this change means that the switch_qemu_logdirty callback implementation in libxl can no longer synchronously produce its return value, as it now needs to wait for xenstore. So we tell the marshalling code generator that it is a message which does not need a reply. This turns the callback function called by the marshaller into one which returns void; the callback function arranges to later explicitly sends the reply to the helper, when the xs watch triggers and the appropriate value is read from xenstore. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_save_callout.c')
-rw-r--r--tools/libxl/libxl_save_callout.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index a6abcda123..078b7eefe5 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -135,6 +135,14 @@ void libxl__xc_domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss,
}
+void libxl__xc_domain_saverestore_async_callback_done(libxl__egc *egc,
+ libxl__save_helper_state *shs, int return_value)
+{
+ shs->egc = egc;
+ libxl__srm_callout_sendreply(return_value, shs);
+ shs->egc = 0;
+}
+
/*----- helper execution -----*/
static void run_helper(libxl__egc *egc, libxl__save_helper_state *shs,