[CRIU] [PATCH 3/8] unix: add ability to set callbacks for external sockets (v2)

Pavel Emelyanov xemul at parallels.com
Wed Dec 11 06:27:18 PST 2013


> @@ -814,6 +840,28 @@ static int open_unixsk_standalone(struct unix_sk_info *ui)
>  		close(sks[1]);
>  		sk = sks[0];
>  	} else {
> +		sk = cr_plugin_restore_unix_sk(ui->ue->ino);
> +		if (sk >= 0) {
> +			ui->ue->uflags |= USK_CALLBACK;

This is the _only_ place where the USK_CALLBACK flag is used. You've probably
missed putting it on dump.

> +			goto out;
> +		}
> +		if (sk != CRIU_CB_SKIP)
> +			return -1;
> +
> +		/*
> +		 * Connect to external sockets requires
> +		 * special option to be passed.
> +		 */
> +		if (ui->peer &&
> +				(ui->peer->ue->uflags & USK_EXTERN) &&
> +				!(opts.ext_unix_sk)) {
> +			pr_err("External socket found in image. "
> +					"Consider using the --" USK_EXT_PARAM " option "
> +					"to allow restoring it.\n");
> +			return -1;
> +		}
> +
> +
>  		sk = socket(PF_UNIX, ui->ue->type, 0);
>  		if (sk < 0) {
>  			pr_perror("Can't make unix socket");


More information about the CRIU mailing list