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

Andrew Vagin avagin at parallels.com
Wed Dec 11 12:11:33 PST 2013


On Wed, Dec 11, 2013 at 06:27:18PM +0400, Pavel Emelyanov wrote:
> > @@ -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.

I forgot to remove it from here. Thanks.

> 
> > +			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