[CRIU] [PATCH 09/13] dump: Checkpoint per-thread blocked signals

Pavel Emelyanov xemul at parallels.com
Wed Nov 7 08:36:05 EST 2012


On 11/07/2012 05:00 PM, Cyrill Gorcunov wrote:
> 
> I've moved dump_thread helper a bit lower in file
> since I've to call for find_thread_state helper.
> After all this groups all thread related functions
> in one slab.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  cr-dump.c                  |    4 +++-
>  include/parasite-syscall.h |    3 ++-
>  include/parasite.h         |    1 +
>  parasite-syscall.c         |    4 +++-
>  parasite.c                 |   36 +++++++++++++++++++++++-------------
>  5 files changed, 32 insertions(+), 16 deletions(-)
> 

> @@ -364,6 +351,29 @@ static struct tid_state_s *find_thread_state(pid_t tid)
>  	return NULL;
>  }
>  
> +static int dump_thread(struct parasite_dump_thread *args)
> +{
> +	pid_t tid = sys_gettid();

:(

> +	struct tid_state_s *s;
> +	int ret;
> +
> +	s = find_thread_state(tid);
> +	if (!s)
> +		return -ENOENT;
> +
> +	if (!s->use_sig_blocked)
> +		return -EINVAL;
> +
> +	ret = sys_prctl(PR_GET_TID_ADDRESS, (unsigned long) &args->tid_addr, 0, 0, 0);
> +	if (ret)
> +		return ret;
> +
> +	args->blocked = s->sig_blocked;
> +	args->tid = tid;
> +
> +	return 0;
> +}

Why did you move the function instead of patching it in-place?

> +
>  static int init_thread(void)
>  {
>  	k_rtsigset_t to_block;



More information about the CRIU mailing list