All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add --nonetns switch to user-cr checkpoint
@ 2010-03-31 14:41 Dan Smith
       [not found] ` <1270046482-16053-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Smith @ 2010-03-31 14:41 UTC (permalink / raw)
  To: containers-qjLDD68F18O7TbgM5vRIOg

This allows the caller to set the CHECKPOINT_NONETNS flag on the checkpoint
operation, thus skipping the checkpointing of network namespaces entirely.

Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 app-checkpoint.h  |    1 +
 checkpoint-main.c |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/app-checkpoint.h b/app-checkpoint.h
index f740085..c078f04 100644
--- a/app-checkpoint.h
+++ b/app-checkpoint.h
@@ -5,6 +5,7 @@ struct app_checkpoint_args {
 	int uerrfd;
 	int container;
 	int verbose;
+	int flags;
 };
 
 struct app_restart_args {
diff --git a/checkpoint-main.c b/checkpoint-main.c
index f6faa32..bef6bfe 100644
--- a/checkpoint-main.c
+++ b/checkpoint-main.c
@@ -30,6 +30,7 @@ static char usage_str[] =
 "  -l,--logfile=FILE     write error and debug data to FILE (default=none)\n"
 "     --logile-fd=FD     write error and debug data to file descriptor FD\n"
 "  -c,--container        require the PID is a container-init\n"
+"     --nonetns          do not checkpoint network namespace(s)\n"
 "  -v,--verbose          verbose output\n"
 "";
 
@@ -61,6 +62,7 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
 		{ "logfile-fd",	required_argument,	NULL, 2 },
 		{ "container",	no_argument,		NULL, 'c' },
 		{ "verbose",	no_argument,		NULL, 'v' },
+		{ "nonetns",	no_argument,		NULL, 3 },
 		{ NULL,		0,			NULL, 0 }
 	};
 	static char optc[] = "hvco:l:";
@@ -71,6 +73,7 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
 	args->outfd = -1;
 	args->logfd = -1;
 	args->uerrfd = fileno(stderr);
+	args->flags = 0;
 	output = NULL;
 	logfile = NULL;
 
@@ -109,6 +112,9 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
 		case 'v':
 			args->verbose = 1;
 			break;
+		case 3:
+			args->flags |= CHECKPOINT_NONETNS;
+			break;
 		default:
 			usage(usage_str);
 		}
@@ -164,6 +170,7 @@ int main(int argc, char *argv[])
 		exit(1);
 	}
 
+	flags = args.flags;
 	if (!args.container)
 		flags |= CHECKPOINT_SUBTREE;
 
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add --nonetns switch to user-cr checkpoint
       [not found] ` <1270046482-16053-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2010-03-31 14:57   ` Serge E. Hallyn
       [not found]     ` <20100331145740.GA11124-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  2010-04-01  4:41   ` Oren Laadan
  1 sibling, 1 reply; 7+ messages in thread
From: Serge E. Hallyn @ 2010-03-31 14:57 UTC (permalink / raw)
  To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg

Quoting Dan Smith (danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> This allows the caller to set the CHECKPOINT_NONETNS flag on the checkpoint
> operation, thus skipping the checkpointing of network namespaces entirely.
> 
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Thanks, Dan.  Can we add '-N' as a synonym for my lazy fingers?

Also, args does get memset to 0 before parse_args() gets called so
you don't need to set args->flag to 0 there.

But

Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

> ---
>  app-checkpoint.h  |    1 +
>  checkpoint-main.c |    7 +++++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/app-checkpoint.h b/app-checkpoint.h
> index f740085..c078f04 100644
> --- a/app-checkpoint.h
> +++ b/app-checkpoint.h
> @@ -5,6 +5,7 @@ struct app_checkpoint_args {
>  	int uerrfd;
>  	int container;
>  	int verbose;
> +	int flags;
>  };
> 
>  struct app_restart_args {
> diff --git a/checkpoint-main.c b/checkpoint-main.c
> index f6faa32..bef6bfe 100644
> --- a/checkpoint-main.c
> +++ b/checkpoint-main.c
> @@ -30,6 +30,7 @@ static char usage_str[] =
>  "  -l,--logfile=FILE     write error and debug data to FILE (default=none)\n"
>  "     --logile-fd=FD     write error and debug data to file descriptor FD\n"
>  "  -c,--container        require the PID is a container-init\n"
> +"     --nonetns          do not checkpoint network namespace(s)\n"
>  "  -v,--verbose          verbose output\n"
>  "";
> 
> @@ -61,6 +62,7 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
>  		{ "logfile-fd",	required_argument,	NULL, 2 },
>  		{ "container",	no_argument,		NULL, 'c' },
>  		{ "verbose",	no_argument,		NULL, 'v' },
> +		{ "nonetns",	no_argument,		NULL, 3 },
>  		{ NULL,		0,			NULL, 0 }
>  	};
>  	static char optc[] = "hvco:l:";
> @@ -71,6 +73,7 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
>  	args->outfd = -1;
>  	args->logfd = -1;
>  	args->uerrfd = fileno(stderr);
> +	args->flags = 0;
>  	output = NULL;
>  	logfile = NULL;
> 
> @@ -109,6 +112,9 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
>  		case 'v':
>  			args->verbose = 1;
>  			break;
> +		case 3:
> +			args->flags |= CHECKPOINT_NONETNS;
> +			break;
>  		default:
>  			usage(usage_str);
>  		}
> @@ -164,6 +170,7 @@ int main(int argc, char *argv[])
>  		exit(1);
>  	}
> 
> +	flags = args.flags;
>  	if (!args.container)
>  		flags |= CHECKPOINT_SUBTREE;
> 
> -- 
> 1.6.3.3
> 
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linux-foundation.org/mailman/listinfo/containers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add --nonetns switch to user-cr checkpoint
       [not found]     ` <20100331145740.GA11124-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2010-03-31 15:12       ` Dan Smith
       [not found]         ` <87634ced9n.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Smith @ 2010-03-31 15:12 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: containers-qjLDD68F18O7TbgM5vRIOg

SH> Also, args does get memset to 0 before parse_args() gets called so
SH> you don't need to set args->flag to 0 there.

I wanted it to be really, really zeroed.

-- 
Dan Smith
IBM Linux Technology Center
email: danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org

Add --nonetns switch to user-cr checkpoint (v2)

This allows the caller to set the CHECKPOINT_NONETNS flag on the checkpoint
operation, thus skipping the checkpointing of network namespaces entirely.

Changes in v2:
 - Allow -N for --nonetns
 - Remove extra flags initialization

Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

diff --git a/app-checkpoint.h b/app-checkpoint.h
index f740085..c078f04 100644
--- a/app-checkpoint.h
+++ b/app-checkpoint.h
@@ -5,6 +5,7 @@ struct app_checkpoint_args {
 	int uerrfd;
 	int container;
 	int verbose;
+	int flags;
 };
 
 struct app_restart_args {
diff --git a/checkpoint-main.c b/checkpoint-main.c
index f6faa32..85b4133 100644
--- a/checkpoint-main.c
+++ b/checkpoint-main.c
@@ -30,6 +30,7 @@ static char usage_str[] =
 "  -l,--logfile=FILE     write error and debug data to FILE (default=none)\n"
 "     --logile-fd=FD     write error and debug data to file descriptor FD\n"
 "  -c,--container        require the PID is a container-init\n"
+"  -N,--nonetns          do not checkpoint network namespace(s)\n"
 "  -v,--verbose          verbose output\n"
 "";
 
@@ -61,9 +62,10 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
 		{ "logfile-fd",	required_argument,	NULL, 2 },
 		{ "container",	no_argument,		NULL, 'c' },
 		{ "verbose",	no_argument,		NULL, 'v' },
+		{ "nonetns",	no_argument,		NULL, 'N' },
 		{ NULL,		0,			NULL, 0 }
 	};
-	static char optc[] = "hvco:l:";
+	static char optc[] = "hvco:l:N";
 	char *output;
 	char *logfile;
 
@@ -109,6 +111,9 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
 		case 'v':
 			args->verbose = 1;
 			break;
+		case 'N':
+			args->flags |= CHECKPOINT_NONETNS;
+			break;
 		default:
 			usage(usage_str);
 		}
@@ -164,6 +169,7 @@ int main(int argc, char *argv[])
 		exit(1);
 	}
 
+	flags = args.flags;
 	if (!args.container)
 		flags |= CHECKPOINT_SUBTREE;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add --nonetns switch to user-cr checkpoint
       [not found]         ` <87634ced9n.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
@ 2010-03-31 15:20           ` Serge E. Hallyn
  0 siblings, 0 replies; 7+ messages in thread
From: Serge E. Hallyn @ 2010-03-31 15:20 UTC (permalink / raw)
  To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg

Quoting Dan Smith (danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> SH> Also, args does get memset to 0 before parse_args() gets called so
> SH> you don't need to set args->flag to 0 there.
> 
> I wanted it to be really, really zeroed.

:)

Looks great.

thanks,
-serge

> -- 
> Dan Smith
> IBM Linux Technology Center
> email: danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
> 
> Add --nonetns switch to user-cr checkpoint (v2)
> 
> This allows the caller to set the CHECKPOINT_NONETNS flag on the checkpoint
> operation, thus skipping the checkpointing of network namespaces entirely.
> 
> Changes in v2:
>  - Allow -N for --nonetns
>  - Remove extra flags initialization
> 
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> 
> diff --git a/app-checkpoint.h b/app-checkpoint.h
> index f740085..c078f04 100644
> --- a/app-checkpoint.h
> +++ b/app-checkpoint.h
> @@ -5,6 +5,7 @@ struct app_checkpoint_args {
>  	int uerrfd;
>  	int container;
>  	int verbose;
> +	int flags;
>  };
> 
>  struct app_restart_args {
> diff --git a/checkpoint-main.c b/checkpoint-main.c
> index f6faa32..85b4133 100644
> --- a/checkpoint-main.c
> +++ b/checkpoint-main.c
> @@ -30,6 +30,7 @@ static char usage_str[] =
>  "  -l,--logfile=FILE     write error and debug data to FILE (default=none)\n"
>  "     --logile-fd=FD     write error and debug data to file descriptor FD\n"
>  "  -c,--container        require the PID is a container-init\n"
> +"  -N,--nonetns          do not checkpoint network namespace(s)\n"
>  "  -v,--verbose          verbose output\n"
>  "";
> 
> @@ -61,9 +62,10 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
>  		{ "logfile-fd",	required_argument,	NULL, 2 },
>  		{ "container",	no_argument,		NULL, 'c' },
>  		{ "verbose",	no_argument,		NULL, 'v' },
> +		{ "nonetns",	no_argument,		NULL, 'N' },
>  		{ NULL,		0,			NULL, 0 }
>  	};
> -	static char optc[] = "hvco:l:";
> +	static char optc[] = "hvco:l:N";
>  	char *output;
>  	char *logfile;
> 
> @@ -109,6 +111,9 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
>  		case 'v':
>  			args->verbose = 1;
>  			break;
> +		case 'N':
> +			args->flags |= CHECKPOINT_NONETNS;
> +			break;
>  		default:
>  			usage(usage_str);
>  		}
> @@ -164,6 +169,7 @@ int main(int argc, char *argv[])
>  		exit(1);
>  	}
> 
> +	flags = args.flags;
>  	if (!args.container)
>  		flags |= CHECKPOINT_SUBTREE;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add --nonetns switch to user-cr checkpoint
       [not found] ` <1270046482-16053-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  2010-03-31 14:57   ` Serge E. Hallyn
@ 2010-04-01  4:41   ` Oren Laadan
       [not found]     ` <4BB4240F.2030706-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Oren Laadan @ 2010-04-01  4:41 UTC (permalink / raw)
  To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg


Looks good, thanks.

I think the default behavior of 'checkpoint' should be to not
chekcpoint net-ns, at the very least in the subtree-checkpoint
case.

I prefer the container case to also not include it by default.

These can be tuned in the 'checkpoint' utility, or (better ?)
by using CHECKPOINT_NETNS instead of CHECKPOINT_NONETNS...

Oren.

Dan Smith wrote:
> This allows the caller to set the CHECKPOINT_NONETNS flag on the checkpoint
> operation, thus skipping the checkpointing of network namespaces entirely.
> 
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
>  app-checkpoint.h  |    1 +
>  checkpoint-main.c |    7 +++++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/app-checkpoint.h b/app-checkpoint.h
> index f740085..c078f04 100644
> --- a/app-checkpoint.h
> +++ b/app-checkpoint.h
> @@ -5,6 +5,7 @@ struct app_checkpoint_args {
>  	int uerrfd;
>  	int container;
>  	int verbose;
> +	int flags;
>  };
>  
>  struct app_restart_args {
> diff --git a/checkpoint-main.c b/checkpoint-main.c
> index f6faa32..bef6bfe 100644
> --- a/checkpoint-main.c
> +++ b/checkpoint-main.c
> @@ -30,6 +30,7 @@ static char usage_str[] =
>  "  -l,--logfile=FILE     write error and debug data to FILE (default=none)\n"
>  "     --logile-fd=FD     write error and debug data to file descriptor FD\n"
>  "  -c,--container        require the PID is a container-init\n"
> +"     --nonetns          do not checkpoint network namespace(s)\n"
>  "  -v,--verbose          verbose output\n"
>  "";
>  
> @@ -61,6 +62,7 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
>  		{ "logfile-fd",	required_argument,	NULL, 2 },
>  		{ "container",	no_argument,		NULL, 'c' },
>  		{ "verbose",	no_argument,		NULL, 'v' },
> +		{ "nonetns",	no_argument,		NULL, 3 },
>  		{ NULL,		0,			NULL, 0 }
>  	};
>  	static char optc[] = "hvco:l:";
> @@ -71,6 +73,7 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
>  	args->outfd = -1;
>  	args->logfd = -1;
>  	args->uerrfd = fileno(stderr);
> +	args->flags = 0;
>  	output = NULL;
>  	logfile = NULL;
>  
> @@ -109,6 +112,9 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
>  		case 'v':
>  			args->verbose = 1;
>  			break;
> +		case 3:
> +			args->flags |= CHECKPOINT_NONETNS;
> +			break;
>  		default:
>  			usage(usage_str);
>  		}
> @@ -164,6 +170,7 @@ int main(int argc, char *argv[])
>  		exit(1);
>  	}
>  
> +	flags = args.flags;
>  	if (!args.container)
>  		flags |= CHECKPOINT_SUBTREE;
>  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add --nonetns switch to user-cr checkpoint
       [not found]     ` <4BB4240F.2030706-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
@ 2010-04-01 14:01       ` Dan Smith
       [not found]         ` <87wrwrclv4.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Smith @ 2010-04-01 14:01 UTC (permalink / raw)
  To: Oren Laadan; +Cc: containers-qjLDD68F18O7TbgM5vRIOg

OL> I think the default behavior of 'checkpoint' should be to not
OL> chekcpoint net-ns, at the very least in the subtree-checkpoint
OL> case.

OL> I prefer the container case to also not include it by default.

OL> These can be tuned in the 'checkpoint' utility, or (better ?)
OL> by using CHECKPOINT_NETNS instead of CHECKPOINT_NONETNS...

Okay, so you want to change NONETNS to NETNS and then make user-cr
have a positive flag instead of a negative one, yes?

-- 
Dan Smith
IBM Linux Technology Center
email: danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add --nonetns switch to user-cr checkpoint
       [not found]         ` <87wrwrclv4.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
@ 2010-04-01 23:42           ` Oren Laadan
  0 siblings, 0 replies; 7+ messages in thread
From: Oren Laadan @ 2010-04-01 23:42 UTC (permalink / raw)
  To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg


Dan Smith wrote:
> OL> I think the default behavior of 'checkpoint' should be to not
> OL> chekcpoint net-ns, at the very least in the subtree-checkpoint
> OL> case.
> 
> OL> I prefer the container case to also not include it by default.
> 
> OL> These can be tuned in the 'checkpoint' utility, or (better ?)
> OL> by using CHECKPOINT_NETNS instead of CHECKPOINT_NONETNS...
> 
> Okay, so you want to change NONETNS to NETNS and then make user-cr
> have a positive flag instead of a negative one, yes?
> 

please ;)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-01 23:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-31 14:41 [PATCH] Add --nonetns switch to user-cr checkpoint Dan Smith
     [not found] ` <1270046482-16053-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 14:57   ` Serge E. Hallyn
     [not found]     ` <20100331145740.GA11124-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 15:12       ` Dan Smith
     [not found]         ` <87634ced9n.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2010-03-31 15:20           ` Serge E. Hallyn
2010-04-01  4:41   ` Oren Laadan
     [not found]     ` <4BB4240F.2030706-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-04-01 14:01       ` Dan Smith
     [not found]         ` <87wrwrclv4.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2010-04-01 23:42           ` Oren Laadan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.