From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: Review: Can we move init_restart_ctx() up ? Date: Fri, 02 Oct 2009 14:26:26 -0400 Message-ID: <4AC645D2.7030409@librato.com> References: <20091002051456.GA6684@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20091002051456.GA6684-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Sukadev Bhattiprolu Cc: Containers List-Id: containers.vger.kernel.org Sukadev Bhattiprolu wrote: > > Would it be easier/cleaner if we initialized the restart ctx soon after > allocating it ? Looks like we already have the information we need at that > point. > > That way, do_restart() won't need the 'pid' parameter and we anyway use > the 'if(ctx)' check to test for the coordinator. I put the {checkpoint,restart}-related work in {checkpoint,restart}.c, and leave sys.c "neutral". I also like the symmetry between do_checkpoint() and do_restart() :p > BTW, can we move the '->active_pid = -1' in init_restart_ctx() to > ckpt_ctx_alloc() itself ? @active_pid is specific to restart, that's why I initialize it there. Oren.