[CRIU] [PATCH 10/22] parasite: Switch parasite to daemon mode

Pavel Emelyanov xemul at parallels.com
Wed May 15 09:17:26 EDT 2013


> @@ -546,17 +676,20 @@ int parasite_init_threads_seized(struct parasite_ctl *ctl, struct pstree_item *i
>  	args = parasite_args(ctl, struct parasite_init_args);
>  
>  	for (i = 0; i < item->nr_threads; i++) {
> -		if (item->pid.real == item->threads[i].real)
> +		pid_t tid = item->threads[i].real;
> +
> +		if (item->pid.real == tid)
>  			continue;
>  
> -		args->real = item->threads[i].real;
> -		ret = parasite_execute_trap_by_pid(PARASITE_CMD_INIT_THREAD, ctl,
> -					      item->threads[i].real);
> +		args->real = tid;
> +		ret = parasite_execute_trap_by_pid(PARASITE_CMD_INIT_THREAD, ctl, tid);
>  		if (ret) {
> -			pr_err("Can't init thread in parasite %d\n",
> -			       item->threads[i].real);
> +			pr_err("Can't init thread in parasite %d\n", tid);
>  			break;
>  		}
> +
> +		if (parasite_daemonize(ctl, tid))
> +			break;

Can we merge INIT_THREAD with DAEMONIZE for sub-threads?

>  	}
>  
>  	return ret;


More information about the CRIU mailing list