From: Daniel Lezcano Date: Thu, 28 May 2009 10:10:50 +0000 (+0200) Subject: change the checkpoint/restart function api X-Git-Tag: lxc_0_6_3~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=920dfa346cf63cd501192dafe9a64a615147fedc;p=thirdparty%2Flxc.git change the checkpoint/restart function api As the checkpoint/restart is expected to be sequential, I pass the file descriptor to checkpoint and restart, so that will be up to the caller to open the file descriptor which can be a pipe, socket, file, etc ... Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/checkpoint.c b/src/lxc/checkpoint.c index d3285ccc1..b7f172dec 100644 --- a/src/lxc/checkpoint.c +++ b/src/lxc/checkpoint.c @@ -44,7 +44,7 @@ lxc_log_define(lxc_checkpoint, lxc); -int lxc_checkpoint(const char *name, const char *statefile, unsigned long flags) +int lxc_checkpoint(const char *name, int fd, unsigned long flags) { return 0; } diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h index 7507ef5b4..db5a4dcd3 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -184,8 +184,7 @@ extern const char *lxc_strerror(int error); * @flags : checkpoint flags * Returns 0 on success, < 0 otherwise */ -extern int lxc_checkpoint(const char *name, const char *statefile, - unsigned long flags); +extern int lxc_checkpoint(const char *name, int fd, unsigned long flags); /* * Restart a container previously frozen @@ -194,8 +193,7 @@ extern int lxc_checkpoint(const char *name, const char *statefile, * @flags : restart flags * Returns 0 on success, < 0 otherwise */ -extern int lxc_restart(const char *name, const char *statefile, - unsigned long flags); +extern int lxc_restart(const char *name, int fd, unsigned long flags); /* * Returns the version number of the library diff --git a/src/lxc/lxc_checkpoint.c b/src/lxc/lxc_checkpoint.c index 72d503b62..767549d0e 100644 --- a/src/lxc/lxc_checkpoint.c +++ b/src/lxc/lxc_checkpoint.c @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) if (ret) return ret; - ret = lxc_checkpoint(my_args.name, my_args.argv[0], 0); + ret = lxc_checkpoint(my_args.name, -1, 0); if (ret) return ret; diff --git a/src/lxc/lxc_restart.c b/src/lxc/lxc_restart.c index 1727fe209..f8b4ce63c 100644 --- a/src/lxc/lxc_restart.c +++ b/src/lxc/lxc_restart.c @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) my_args.progname, my_args.quiet)) return -1; - if (lxc_restart(my_args.name, my_args.argv[0], 0)) + if (lxc_restart(my_args.name, -1, 0)) return -1; return 0; diff --git a/src/lxc/restart.c b/src/lxc/restart.c index 8084e79ce..f382ae38e 100644 --- a/src/lxc/restart.c +++ b/src/lxc/restart.c @@ -47,8 +47,7 @@ lxc_log_define(lxc_restart, lxc); LXC_TTY_HANDLER(SIGINT); LXC_TTY_HANDLER(SIGQUIT); -int lxc_restart(const char *name, const char *statefile, - unsigned long flags) +int lxc_restart(const char *name, int fd, unsigned long flags) { return 0; }