aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xcutils
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-10-21 18:46:32 +0100
committerIan Campbell <ian.campbell@citrix.com>2010-10-21 18:46:32 +0100
commita050657a54f734d6ed809072f9c1329d8324ee67 (patch)
treeb253477d9ded8728a0722ccc31da7c76a56f2836 /tools/xcutils
parent49fa0e868f1e3748a25c60cf2a36b5c40a135b83 (diff)
downloadxen-a050657a54f734d6ed809072f9c1329d8324ee67.tar.gz
xen-a050657a54f734d6ed809072f9c1329d8324ee67.tar.bz2
xen-a050657a54f734d6ed809072f9c1329d8324ee67.zip
tools: cleanup domain save switch_qemu_logdirty callback
Move the function into struct save_callbacks with the others and add the void *closure to the callback arguments. Add and propagate an error return code from the callback. Use this in libxl to pass the save context to libxl__domain_suspend_common_switch_qemu_logdirty allowing us to reuse the parent's xenstore handle, gc context etc. Also add an apparently missing libxl__free_all to libxl__domain_suspend_common. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/xcutils')
-rw-r--r--tools/xcutils/xc_save.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c
index cdf62afba6..4ae7e4cf9c 100644
--- a/tools/xcutils/xc_save.c
+++ b/tools/xcutils/xc_save.c
@@ -102,7 +102,7 @@ static int suspend(void* data)
* active buffer. */
-static void switch_qemu_logdirty(int domid, unsigned int enable)
+static int switch_qemu_logdirty(int domid, unsigned int enable, void *data)
{
struct xs_handle *xs;
char *path, *p, *ret_str, *cmd_str, **watch;
@@ -159,6 +159,8 @@ static void switch_qemu_logdirty(int domid, unsigned int enable)
free(path);
free(cmd_str);
free(ret_str);
+
+ return 0;
}
int
@@ -205,9 +207,9 @@ main(int argc, char **argv)
}
memset(&callbacks, 0, sizeof(callbacks));
callbacks.suspend = suspend;
+ callbacks.switch_qemu_logdirty = switch_qemu_logdirty;
ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, si.flags,
- &callbacks, !!(si.flags & XCFLAGS_HVM),
- &switch_qemu_logdirty);
+ &callbacks, !!(si.flags & XCFLAGS_HVM));
if (si.suspend_evtchn > 0)
xc_suspend_evtchn_release(si.xch, si.xce, si.domid, si.suspend_evtchn);