[CRIU] Re: [PATCH] dump: global image names introduced

Pavel Emelyanov xemul at parallels.com
Tue Mar 20 15:43:06 EDT 2012


> @@ -179,6 +180,13 @@ int open_image(int type, unsigned long flags, ...)
>  		}
>  	}
>  
> +	if (flags & O_APPEND) {
> +		struct stat tmp;
> +
> +		if (stat(path, &tmp) == 0)
> +			write_magic = 0;
> +	}

A scenario. You run crtools dump and it doesn't work, but some image files
are created. You fix smth and run it again. The image files being opened with
O_APPEND are not re-initialized.

> +
>  	ret = openat(image_dir_fd, path, flags, CR_FD_PERM);
>  	if (ret < 0) {
>  		pr_perror("Unable to open %s", path);


More information about the CRIU mailing list