[CRIU] [PATCH] files_reg: carry rdev with regular files

Pavel Emelyanov xemul at virtuozzo.com
Wed Jul 13 06:20:30 PDT 2016


On 07/06/2016 05:26 PM, Stanislav Kinsburskiy wrote:
> Will be required to create silly-renamed device files on SPFS.
> Note: rdev is carried as a part of ghost file information, but it's not used
> in case of silly-renamed files.
> 
> Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
> ---
>  criu/files-reg.c     |    5 +++++
>  images/regfile.proto |    1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/criu/files-reg.c b/criu/files-reg.c
> index 157cb8f..588fbc4 100644
> --- a/criu/files-reg.c
> +++ b/criu/files-reg.c
> @@ -1187,6 +1187,11 @@ ext:
>  		rfe.size = p->stat.st_size;
>  	}
>  
> +	if (S_ISCHR(p->stat.st_mode) || S_ISBLK(p->stat.st_mode)) {
> +		rfe.has_rdev = true;
> +		rfe.rdev = p->stat.st_rdev;
> +	}
> +

This won't be called for /dev/tun and all sort of ttys as they don't
use dump_one_reg_file().

>  	rimg = img_from_set(glob_imgset, CR_FD_REG_FILES);
>  	return pb_write_one(rimg, &rfe, PB_REG_FILE);
>  }
> diff --git a/images/regfile.proto b/images/regfile.proto
> index bc4c14d..3db0820 100644
> --- a/images/regfile.proto
> +++ b/images/regfile.proto
> @@ -13,4 +13,5 @@ message reg_file_entry {
>  	optional uint64		size	= 8;
>  	optional bool		ext	= 9;
>  	optional uint32         mode    = 10;
> +	optional uint32         rdev    = 11;
>  }
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
> .
> 



More information about the CRIU mailing list