Linux Container Development
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: [RFC][PATCH 2/6][usercr] Remove flags parameter to cr_checkpoint()
Date: Tue, 13 Apr 2010 17:52:21 -0700	[thread overview]
Message-ID: <20100414005221.GB13532@us.ibm.com> (raw)
In-Reply-To: <20100414004927.GA13012-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>


From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Date: Tue, 13 Apr 2010 15:28:55 -0700
Subject: [RFC][PATCH 2/6][usercr] Remove flags parameter to cr_checkpoint()

For consistency with cr_restart(), remove 'flags' parameter to cr_checkpoint().
Given that we pass in the 'struct cr_checkpoint_args' the flags parameter is
anyway redundant.

Signed-off-by: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
 checkpoint-main.c |    6 +-----
 checkpoint.c      |    7 +++++--
 cr_checkpoint.h   |    4 +---
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/checkpoint-main.c b/checkpoint-main.c
index 48c54f6..b8f96a7 100644
--- a/checkpoint-main.c
+++ b/checkpoint-main.c
@@ -147,7 +147,6 @@ int main(int argc, char *argv[])
 {
 	int ret;
 	struct cr_checkpoint_args args;
-	unsigned long flags = 0;
 	pid_t pid;
 
 	global_uerrfd = fileno(stderr);
@@ -165,9 +164,6 @@ int main(int argc, char *argv[])
 		exit(1);
 	}
 
-	if (!args.container)
-		flags |= CHECKPOINT_SUBTREE;
-
-	ret = cr_checkpoint(pid, flags, &args);
+	ret = cr_checkpoint(pid, &args);
 	return (ret > 0) ? 0 : 1;
 }
diff --git a/checkpoint.c b/checkpoint.c
index 5472bfe..90d4d35 100644
--- a/checkpoint.c
+++ b/checkpoint.c
@@ -31,10 +31,10 @@ inline static int checkpoint(pid_t pid, int fd, unsigned long flags, int logfd)
 	return syscall(__NR_checkpoint, pid, fd, flags, logfd);
 }
 
-int cr_checkpoint(int pid, unsigned long flags,
-				struct cr_checkpoint_args *args)
+int cr_checkpoint(int pid, struct cr_checkpoint_args *args)
 {
 	int ret;
+	unsigned long flags;
 
 	global_uerrfd = args->uerrfd;
 
@@ -46,6 +46,9 @@ int cr_checkpoint(int pid, unsigned long flags,
 	if (args->logfd < 0)
 		args->logfd = CHECKPOINT_FD_NONE;
 
+	if (!args->container)
+		flags |= CHECKPOINT_SUBTREE;
+
 	ret = checkpoint(pid, args->outfd, flags, args->logfd);
 
 	if (ret < 0) {
diff --git a/cr_checkpoint.h b/cr_checkpoint.h
index 81fa2c2..37f9f2a 100644
--- a/cr_checkpoint.h
+++ b/cr_checkpoint.h
@@ -39,7 +39,5 @@ struct cr_restart_args {
  */
 extern int global_send_sigint;
 
-extern int cr_checkpoint(int pid, unsigned long flags,
-				struct cr_checkpoint_args *args);
-
+extern int cr_checkpoint(int pid, struct cr_checkpoint_args *args);
 extern int cr_restart(struct cr_restart_args *args);
-- 
1.6.6.1

  parent reply	other threads:[~2010-04-14  0:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14  0:49 [RFC][PATCH 0/6][usercr]: Rename/reorg usercr code Sukadev Bhattiprolu
     [not found] ` <20100414004927.GA13012-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-14  0:52   ` [RFC][PATCH 1/6][usercr] Change API prefix to cr_ Sukadev Bhattiprolu
2010-04-14  0:52   ` Sukadev Bhattiprolu [this message]
2010-04-14  0:52   ` [RFC][PATCH 3/6][usercr] Minor reorg of restart.c Sukadev Bhattiprolu
2010-04-14  0:52   ` [RFC][PATCH 4/6][usercr] Move checkpoint() into restart.c Sukadev Bhattiprolu
2010-04-14  0:53   ` [RFC][PATCH 5/6][usercr] Rename restart.c to cr_checkpoint.c Sukadev Bhattiprolu
2010-04-14  0:53   ` [RFC][PATCH 6/6][usercr] Rename common.h to cr_log.h Sukadev Bhattiprolu
2010-04-20 18:07   ` [RFC][PATCH 0/6][usercr]: Rename/reorg usercr code Sukadev Bhattiprolu
     [not found]     ` <20100420180733.GA13874-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-25 20:24       ` Oren Laadan
     [not found]         ` <4BD4A501.6070106-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-04-26 17:16           ` Sukadev Bhattiprolu
     [not found]             ` <20100426171603.GB27542-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-26 18:46               ` Oren Laadan
2010-06-14 21:31           ` Oren Laadan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100414005221.GB13532@us.ibm.com \
    --to=sukadev-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox