[CRIU] [PATCH] restore: Set CLONE_PARENT iif pdeath_sig is present, v3

Pavel Emelyanov xemul at parallels.com
Thu Aug 14 11:46:06 PDT 2014


On 08/14/2014 10:34 PM, Cyrill Gorcunov wrote:
> On Thu, Aug 14, 2014 at 10:24:02PM +0400, Pavel Emelyanov wrote:
>>
>> If we restore non-containerized tree the init's pid will not be 1.
>> Need to compare item with root_item.
> 
> yes, my bad. sorry for delay, has been testing update. attached.

Let's do v4, OK?

> -	/*
> -	 * This means we're called from lib's criu_restore_child().
> -	 * In that case create the root task as the child one to+
> -	 * the caller. This is the only way to correctly restore the
> -	 * pdeath_sig of the root task. But also looks nice.
> -	 *
> -	 * Alternatively, if we are --restore-detached, a similar trick is
> -	 * needed to correctly restore pdeath_sig and prevent processes from
> -	 * dying once restored.
> -	 */
> -	if (opts.swrk_restore || opts.restore_detach)
> -		init->rst->clone_flags |= CLONE_PARENT;
> -
>  	ret = fork_with_pid(init);
>  	if (ret < 0)
>  		return -1;

Below this line there's one more place deserving the
-	opts.swrk_restore || opts.restore_detached
+	root_as_sibling

change.

Thanks,
Pavel



More information about the CRIU mailing list