[CRIU] [PATCH 8/9] files: add ability to set callbacks for files (v5)

Pavel Emelyanov xemul at parallels.com
Thu Dec 19 09:48:05 PST 2013


> +int dump_one_unsupp_file(int lfd, u32 id, const struct fd_parms *p)
> +{
> +	int rfd;
> +
> +	UnsuppFileEntry ufe = UNSUPP_FILE_ENTRY__INIT;
> +
> +	if (cr_plugin_dump_file(lfd, id))
> +		return -1;
> +
> +	ufe.id		= id;
> +	ufe.fown	= (FownEntry *)&p->fown;
> +
> +	rfd = fdset_fd(glob_fdset, CR_FD_UNSUPP_FILES);
> +
> +	return pb_write_one(rfd, &ufe, PB_UNSUPP_FILE);
> +}
> +
> +const struct fdtype_ops unsupp_dump_ops = {
> +	.type		= FD_TYPES__UNSUPP,

This constant is not introduced in this set.

> +	.dump		= dump_one_unsupp_file,
> +};
> +
> +struct unsupp_file_info {
> +	struct file_desc	d;
> +	UnsuppFileEntry		*ufe;
> +};

> +int dump_unsupp_fd(struct fd_parms *p, int lfd,
> +			  const int fdinfo, char *more, char *info)
> +{
> +	int ret;
> +
> +	ret = do_dump_gen_file(p, lfd, &unsupp_dump_ops, fdinfo);
> +	if (ret == 0)
> +		return 0;
> +	if (ret == -ENOTSUP)

Nobody from this patch returns this error code.

> +		pr_err("Can't dump file %d of that type [%o] (%s %s)\n",
> +			p->fd, p->stat.st_mode, more, info);
> +	return -1;
> +}


More information about the CRIU mailing list