Commit 920dfa34 by Daniel Lezcano

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: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 34c66a69
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
lxc_log_define(lxc_checkpoint, lxc); 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; return 0;
} }
...@@ -184,8 +184,7 @@ extern const char *lxc_strerror(int error); ...@@ -184,8 +184,7 @@ extern const char *lxc_strerror(int error);
* @flags : checkpoint flags * @flags : checkpoint flags
* Returns 0 on success, < 0 otherwise * Returns 0 on success, < 0 otherwise
*/ */
extern int lxc_checkpoint(const char *name, const char *statefile, extern int lxc_checkpoint(const char *name, int fd, unsigned long flags);
unsigned long flags);
/* /*
* Restart a container previously frozen * Restart a container previously frozen
...@@ -194,8 +193,7 @@ extern int lxc_checkpoint(const char *name, const char *statefile, ...@@ -194,8 +193,7 @@ extern int lxc_checkpoint(const char *name, const char *statefile,
* @flags : restart flags * @flags : restart flags
* Returns 0 on success, < 0 otherwise * Returns 0 on success, < 0 otherwise
*/ */
extern int lxc_restart(const char *name, const char *statefile, extern int lxc_restart(const char *name, int fd, unsigned long flags);
unsigned long flags);
/* /*
* Returns the version number of the library * Returns the version number of the library
......
...@@ -84,7 +84,7 @@ int main(int argc, char *argv[]) ...@@ -84,7 +84,7 @@ int main(int argc, char *argv[])
if (ret) if (ret)
return ret; return ret;
ret = lxc_checkpoint(my_args.name, my_args.argv[0], 0); ret = lxc_checkpoint(my_args.name, -1, 0);
if (ret) if (ret)
return ret; return ret;
......
...@@ -65,7 +65,7 @@ int main(int argc, char *argv[]) ...@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
my_args.progname, my_args.quiet)) my_args.progname, my_args.quiet))
return -1; return -1;
if (lxc_restart(my_args.name, my_args.argv[0], 0)) if (lxc_restart(my_args.name, -1, 0))
return -1; return -1;
return 0; return 0;
......
...@@ -47,8 +47,7 @@ lxc_log_define(lxc_restart, lxc); ...@@ -47,8 +47,7 @@ lxc_log_define(lxc_restart, lxc);
LXC_TTY_HANDLER(SIGINT); LXC_TTY_HANDLER(SIGINT);
LXC_TTY_HANDLER(SIGQUIT); LXC_TTY_HANDLER(SIGQUIT);
int lxc_restart(const char *name, const char *statefile, int lxc_restart(const char *name, int fd, unsigned long flags)
unsigned long flags)
{ {
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment