On Mon, Jun 22, 2009 at 12:12:56PM -0700, Dan Smith wrote: > This patch adds AF_INET c/r support based on the framework established in > my AF_UNIX patch. I've tested it by checkpointing a single app with a > pair of sockets connected over loopback. > > I expect a pile of comments :) > > A couple points about the operation: > > 1. In order to properly hook up the established sockets with the matching > listening parent socket, I added a new list to the ckpt_ctx and run the > parent attachment in the deferqueue at the end of the restart process. > 2. I don't do anything to redirect or freeze traffic flowing to or from the > remote system (to prevent a RST from breaking things). I expect that > userspace will bring down a veth device or freeze traffic to the remote > system to handle this case. > > Cc: Oren Laaden <orenl@xxxxxxxxxxxxxxx> > Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> > Signed-off-by: Dan Smith <danms@xxxxxxxxxx> > --- > checkpoint/sys.c | 2 + > include/linux/checkpoint_hdr.h | 1 + > include/linux/checkpoint_types.h | 2 + > include/linux/socket.h | 95 ++++++++++ > net/checkpoint.c | 369 +++++++++++++++++++++++++++++++++----- > 5 files changed, 428 insertions(+), 41 deletions(-) > > diff --git a/checkpoint/sys.c b/checkpoint/sys.c > index 38a5299..b6f18ea 100644 > --- a/checkpoint/sys.c > +++ b/checkpoint/sys.c > @@ -242,6 +242,8 @@ static struct ckpt_ctx *ckpt_ctx_alloc(int fd, unsigned long uflags, > INIT_LIST_HEAD(&ctx->pgarr_pool); > init_waitqueue_head(&ctx->waitq); > > + INIT_LIST_HEAD(&ctx->listen_sockets); > + > err = -EBADF; > ctx->file = fget(fd); > if (!ctx->file) > diff --git a/include/linux/checkpoint_hdr.h b/include/linux/checkpoint_hdr.h > index 46285f8..0a19767 100644 > --- a/include/linux/checkpoint_hdr.h > +++ b/include/linux/checkpoint_hdr.h > @@ -87,6 +87,7 @@ enum { > CKPT_HDR_SOCKET_BUFFERS, > CKPT_HDR_SOCKET_BUFFER, > CKPT_HDR_SOCKET_UN, > + CKPT_HDR_SOCKET_IN, Nano-nit: I think it's easier to read if we call these CKPT_HDR_SOCKET_UNIX and CKPT_HDR_SOCKET_INET. The extra 2 characters are worth that. This also applies to the struct names later in the patch. Cheers, -Matt Helsley _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers