[Devel] [PATCH 2/2] Add keep_frozen field to struct app_restart_args

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Tue Mar 30 23:56:02 PDT 2010


From: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
Date: Tue, 30 Mar 2010 23:14:53 -0700
Subject: [PATCH 2/2] Add keep_frozen field to struct app_restart_args

Add a field, keep_frozen that callers of app_restart() can use to leave the
application frozen after restart. When this field is set, have app_restart()
set the RESTART_FROZEN flag to sys_restart().

TODO:
	For now, this field will be used in LXC containers.  A follow-on
	patch would add a command line option to /bin/restart to let users
	select this behavior.
---
 app-checkpoint.h |    3 +++
 restart.c        |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/app-checkpoint.h b/app-checkpoint.h
index f740085..d2455f3 100644
--- a/app-checkpoint.h
+++ b/app-checkpoint.h
@@ -1,3 +1,5 @@
+#include <linux/checkpoint.h>
+#include <linux/checkpoint_hdr.h>
 
 struct app_checkpoint_args {
 	int outfd;
@@ -19,6 +21,7 @@ struct app_restart_args {
 	int show_status;
 	int copy_status;
 	char *freezer;
+	int keep_frozen;
 	int infd;
 	int klogfd;
 	int ulogfd;
diff --git a/restart.c b/restart.c
index 5408152..d5fee0b 100644
--- a/restart.c
+++ b/restart.c
@@ -914,7 +914,7 @@ static int ckpt_coordinator(struct ckpt_ctx *ctx)
 	if (ckpt_probe_child(root_pid, "root task") < 0)
 		exit(1);
 
-	if (ctx->args->freezer)
+	if (ctx->args->freezer || ctx->args->keep_frozen)
 		flags |= RESTART_FROZEN;
 	if (ctx->args->keep_lsm)
 		flags |= RESTART_KEEP_LSM;
-- 
1.6.6.1

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list