[CRIU] Re: [PATCH 3/3] util-net: Add ability to send/receive arrays of file descriptors

Cyrill Gorcunov gorcunov at openvz.org
Tue Mar 20 13:24:39 EDT 2012


On Tue, Mar 20, 2012 at 09:14:30PM +0400, Pavel Emelyanov wrote:
> 
> What for? The glibc memcpy just works.
> But anyway, even if we do need it it should go in separate patch.

Sure, I'll update. (We need own memcpy since we use recv_fd in parasite code).

> > +		int		__nr_fds;
> 
> This union-ing is obfuscating.
> 

ok

> > +extern int recv_fds(int sock, int *fds, int nr_fds);
> 
> This whole bunch of functions
> a) is not used outside util-net.c
> b) has wrong declared return arguments versus used by callers

could you please elaborate on b? in all callers we interested if function
is successed or not, we never was checking for amount of bytes sent/received
so there is no breakage. Or you mean something else?

> It's worth splitting this patch into
> 3.1 put all the msg, iov, cmsg, etc. onto a helper bounding structure
> 3.2 add support for multiple fds sending/receiving
> to make the review easier.
> 

ok

> > +	scm_fdset_init(&fdset);
> > +	scm_fdset_set_addr(&fdset, saddr, saddr_len);
> 
> _init and _set_addr are never used separately. It worth replacing two calls with one.

ok, will update, thanks Pavel!

	Cyrill


More information about the CRIU mailing list