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 <dlezcano@fr.ibm.com>
This commit is contained in:
Daniel Lezcano 2009-05-28 12:10:50 +02:00
parent 34c66a6980
commit 920dfa346c
5 changed files with 6 additions and 9 deletions

View File

@ -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;
} }

View File

@ -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,
* @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

View File

@ -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;

View File

@ -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;

View File

@ -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;
} }