[CRIU] Re: [PATCH 8/8] sockets: Restore in-flight unix stream sockets

Cyrill Gorcunov gorcunov at openvz.org
Fri Jan 27 10:56:57 EST 2012


On Fri, Jan 27, 2012 at 07:41:58PM +0400, Pavel Emelyanov wrote:
> > +	u8	status;
> 
> u8 flags;
> 
> #define USK_INFLIGHT	0x1
> 
> etc...
>

ok

> >  
> >  static struct socket_desc *sockets[SK_HASH_SIZE];
> > -__gen_static_lookup_func(struct socket_desc, lookup_socket, sockets, ino, int, ino);
> > +__gen_static_lookup_func(struct socket_desc, lookup_socket, sockets, ino, unsigned int, ino);
> 
> Why do you change int into unsigned int? "While I'm at it" changes should go in separate patches.
> 

ok

> > +
> > +static struct unix_sk_memo *unix_memos[SK_HASH_SIZE];
> > +__gen_static_lookup_func(struct unix_sk_memo, lookup_unix_memo, unix_memos, ino, unsigned int, ino);
> 
> This hashtable should be called unix_listeners.
> Why can't we put the existing socket desc here? Why yet another unix_sk_memo?
> 

Because it's different types. This hash serves 2 purposes -- at checkpoint type
it collects listeners _and_ icons, while at restore type it collects listeners
only. So plain socket_desc is not enought here. Moreover when you read unix
entries from image you save it in local variable and then create connect-job
if needed but I have to carry every-single listening socket read from disk
and can free it after connect-job complete.

Thus I thought having one separate structure and hash over it -- would be
easier than anything else.

> >  static int sk_collect_one(int ino, int family, struct socket_desc *d)
> >  {
> 

	Cyrill


More information about the CRIU mailing list