All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Sukadev Bhattiprolu
	<sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [PATCH 02/12][user-cr] restart: Add args->send_sigint
Date: Sun, 14 Mar 2010 23:52:24 -0400	[thread overview]
Message-ID: <4B9DAEF8.50700@cs.columbia.edu> (raw)
In-Reply-To: <20100305223658.GB15939-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>


Nack - the library should not handle signals for callers.

Instead, there should be an interface through which the caller
can ask the library to destroy the tree that it just created.
Thus it will be the caller who catches the signal and acts on
it.

Oren.

Sukadev Bhattiprolu wrote:
> From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> Date: Thu, 4 Mar 2010 17:37:39 -0800
> Subject: [PATCH 02/12][user-cr] restart: Add args->send_sigint
> 
> restart command supports a command line option, --send-sigint to let
> user specify whether SIGINT signal should be processed/ignored during
> restart. Make this a field in 'struct app_restart_args' so that other
> callers of app_restart() in the future can also control the SIGINT
> behavior.
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> ---
>  restart.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/restart.c b/restart.c
> index 0c74bb6..314390c 100644
> --- a/restart.c
> +++ b/restart.c
> @@ -376,6 +376,7 @@ struct app_restart_args {
>  	int pids;
>  	int pidns;
>  	int inspect;
> +	int send_sigint;
>  	char *root;
>  	int wait;
>  	int mntns;
> @@ -497,6 +498,7 @@ static void parse_args(struct app_restart_args *args, int argc, char *argv[])
>  	args->klogfd = -1;
>  	args->warn = CKPT_COND_WARN;
>  	args->fail = CKPT_COND_FAIL;
> +	args->send_sigint = -1;
>  	no_pidns = 0;
>  
>  	klogfile = NULL;
> @@ -554,7 +556,7 @@ static void parse_args(struct app_restart_args *args, int argc, char *argv[])
>  				ckpt_err("restart: invalid signal\n");
>  				exit(1);
>  			}
> -			global_send_sigint = sig;
> +			args->send_sigint = sig;
>  			break;
>  		case 3:  /* --pids */
>  			args->pids = 1;
> @@ -815,6 +817,8 @@ int app_restart(struct app_restart_args *args)
>  	memset(&ctx, 0, sizeof(ctx));
>  	ctx.args = args;
>  
> +	global_send_sigint = args->send_sigint;
> +
>  	/* input file descriptor (default: stdin) */
>  	if (args->infd >= 0) {
>  		if (dup2(args->infd, STDIN_FILENO) < 0) {

  parent reply	other threads:[~2010-03-15  3:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05 22:34 [PATCH 0/12][user-cr]: Second set of cleanups Sukadev Bhattiprolu
     [not found] ` <20100305223439.GA15300-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-05 22:36   ` [PATCH 01/12][user-cr] restart: Mark globals as static Sukadev Bhattiprolu
2010-03-05 22:36   ` [PATCH 02/12][user-cr] restart: Add args->send_sigint Sukadev Bhattiprolu
     [not found]     ` <20100305223658.GB15939-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-15  3:52       ` Oren Laadan [this message]
2010-03-05 22:37   ` [PATCH 03/12][user-cr] Add app_restart_args->debug Sukadev Bhattiprolu
     [not found]     ` <20100305223723.GC15939-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-08 19:39       ` Serge E. Hallyn
     [not found]         ` <20100308193929.GA20030-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-08 20:42           ` Sukadev Bhattiprolu
2010-03-05 22:37   ` [PATCH 04/12][user-cr] Add app_restart_args->verbose Sukadev Bhattiprolu
2010-03-05 22:38   ` [PATCH 05/12][user-cr] Add app_restart_args->ulogfd Sukadev Bhattiprolu
2010-03-05 22:38   ` [PATCH 06/12][user-cr] Add app_restart_args->uerrfd Sukadev Bhattiprolu
2010-03-05 22:38   ` [PATCH 07/12][user-cr] Define INIT_SIGNAL_ARRAY Sukadev Bhattiprolu
2010-03-05 22:39   ` [PATCH 08/12][user-cr] Create common.h Sukadev Bhattiprolu
     [not found]     ` <20100305223907.GH15939-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-08 19:44       ` Serge E. Hallyn
     [not found]         ` <20100308194427.GB20030-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-08 20:22           ` Sukadev Bhattiprolu
2010-03-05 22:39   ` [PATCH 09/12][user-cr] Create app-checkpoint.h Sukadev Bhattiprolu
2010-03-05 22:39   ` [PATCH 10/12][user-cr] restart: Move main() to restart-main.c Sukadev Bhattiprolu
2010-03-05 22:40   ` [PATCH 11/12][user-cr] checkpoint: Move main() to checkpoint-main.c Sukadev Bhattiprolu
2010-03-05 22:40   ` [PATCH 12/12][user-cr] Have app_restart() return pid Sukadev Bhattiprolu
2010-03-08 19:49   ` [PATCH 0/12][user-cr]: Second set of cleanups Serge E. Hallyn

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=4B9DAEF8.50700@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@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 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.