[CRIU] Re: [PATCH 02/28] dump: open global image files with global helpers

Pavel Emelyanov xemul at parallels.com
Thu Mar 22 14:57:50 EDT 2012


On 03/22/2012 09:57 PM, Kinsbursky Stanislav wrote:
> From: Stanislav Kinsbursky <skinsbursky at openvz.org>
> 
> v2: added unlink of global files prior to dump stage.
> 
> Now global image files has not pid numbers in it's name.
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
> ---
>  cr-dump.c         |   22 ++++++++++++++++++++--
>  cr-restore.c      |    4 ++--
>  cr-show.c         |    2 +-
>  include/crtools.h |    4 ++--
>  sockets.c         |    2 +-
>  5 files changed, 26 insertions(+), 8 deletions(-)

> +static int unlink_global_image_files(void)
> +{
> +	char path[PATH_MAX];
> +
> +	snprintf(path, PATH_MAX, fdset_template[CR_FD_SK_QUEUES].fmt);
> +	if (unlinkat(image_dir_fd, path, 0) && errno != ENOENT)
> +		goto err;

How about the pstree file? It's opened with these _glob_ helpers and
thus is no longer unlinked.

> +	return 0;
> +
> +err:
> +	pr_perror("Unable to unlink %s", path);
> +	return -1;
> +}



More information about the CRIU mailing list