[CRIU] Re: [PATCH 3/3] protobuf: use generic show function for pstree

Pavel Emelyanov xemul at parallels.com
Fri Jul 20 04:21:32 EDT 2012


On 07/20/2012 12:03 PM, Kinsbursky Stanislav wrote:
> From: Stanislav Kinsbursky <skinsbursky at openvz.org>
> 
> Now, there are two different functions: one for show and one for tasks
> collect.
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
> ---
>  cr-show.c |   53 ++++++++++++++++++-----------------------------------
>  1 files changed, 18 insertions(+), 35 deletions(-)

> @@ -527,11 +508,13 @@ static int cr_show_all(struct cr_options *opts)
>  	fd = open_image_ro(CR_FD_PSTREE);
>  	if (fd < 0)
>  		goto out;
> +	ret = collect_pstree(fd, &pstree_list);
> +	close(fd);
>  
> -	ret = show_collect_pstree(fd, &pstree_list);
> -	if (ret)
> +	fd = open_image_ro(CR_FD_PSTREE);

Double opening? O_o


> +	if (fd < 0)
>  		goto out;
> -
> +	show_pstree(fd, NULL);
>  	close(fd);
>  
>  	fd = open_image_ro(CR_FD_SK_QUEUES);



More information about the CRIU mailing list