[CRIU] Re: [PATCH 06/12] parasite: Add interface for file
descriptors draining
Cyrill Gorcunov
gorcunov at openvz.org
Tue Mar 27 09:37:05 EDT 2012
On Tue, Mar 27, 2012 at 05:12:02PM +0400, Cyrill Gorcunov wrote:
> > > +
> > > + /* Verify the descriptors do match */
> > > + for (i = 0; i < nr_fds; i++) {
> > > + pid_t me = getpid();
> > > + if (sys_kcmp(me, ctl->pid, KCMP_FILE, fds[i], lfds[i])) {
> >
> > I.e. me's fds[i] should be equal to other's lfds[i], meanwhile the fds array
> > contains other's descriptors and the lfds one -- locally received ones.
> >
> > How does it work?
>
> They are equal, the fds[] is the fd numbers in dumpee, the ldf is the ones
> received (and in same order), so they should point to the same struct file,
> thus kcmp can check this condition (fds and ldfs are not same place in memory).
>
Btw, this snippet is removed by last patch in series, I simply don't wanted to
remake all series and patched it on top.
Cyrill
More information about the CRIU
mailing list