<div dir="ltr">Andrei,<div><br></div><div>thanks, that did the trick. I will now send the patches.</div><div><br></div><div>cheers,</div><div>rodrigo</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-12 17:29 GMT+01:00 Andrei Vagin <span dir="ltr"><<a href="mailto:avagin@virtuozzo.com" target="_blank">avagin@virtuozzo.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, May 12, 2018 at 02:32:41PM +0100, Rodrigo Bruno wrote:<br>
> Hi,<br>
> <br>
> it seams that I cannot build criu-dev (I can still build the master branch):<br>
> <br>
> In file included from soccr/soccr.c:9:0:<br>
> soccr/soccr.h:14:8: error: redefinition of ‘struct tcp_repair_window’<br>
> struct tcp_repair_window {<br>
> ^~~~~~~~~~~~~~~~~<br>
> In file included from soccr/soccr.c:5:0:<br>
> /usr/include/netinet/tcp.h:<wbr>319:8: note: originally defined here<br>
> struct tcp_repair_window<br>
> ^~~~~~~~~~~~~~~~~<br>
> <br>
> <br>
> Currently using: Linux criu-devel 4.15.0-20-generic<br>
> <br>
> Any idea?<br>
<br>
</span>We have a feature test, which should detect tcp_repair_window in<br>
netinet/tcp.h<br>
<br>
scripts/feature-tests.mak:<br>
<br>
define FEATURE_TEST_TCP_REPAIR_WINDOW<br>
<br>
#include <netinet/tcp.h><br>
<br>
int main(void)<br>
{<br>
struct tcp_repair_window opts;<br>
<br>
opts.snd_wl1 = 0;<br>
<br>
return opts.snd_wl1;<br>
}<br>
endef<br>
<br>
<br>
Could you try to clean a source directory and compile again?<br>
<br>
git clean -dxf<br>
<div class="HOEnZb"><div class="h5"><br>
> <br>
> cheers,<br>
> rodrigo<br>
> <br>
> 2018-05-10 17:19 GMT+01:00 Andrei Vagin <<a href="mailto:avagin@virtuozzo.com">avagin@virtuozzo.com</a>>:<br>
> <br>
> > On Thu, May 10, 2018 at 10:05:37AM +0100, Rodrigo Bruno wrote:<br>
> > > Hi Andrei and Radostin,<br>
> > ><br>
> > > in our last iteration, I sent to Andei a patch to rework the cache-proxy<br>
> > > code to be single threaded.<br>
> > ><br>
> > > Is it possible to merge that patch into CRIU dev?<br>
> ><br>
> > Yes, it is. Could you send the last version into the maling list?<br>
> ><br>
> > Thanks,<br>
> > Andrei<br>
> ><br>
> > ><br>
> > > I think it would be easy this way because we would be then working on<br>
> > small<br>
> > > code changes to fix bugs related to tests failing.<br>
> > ><br>
> > > I would be able to help fixing the implementation.<br>
> > ><br>
> > > best,<br>
> > > rodrigo<br>
> > ><br>
> > > 2018-05-10 2:10 GMT+01:00 Andrei Vagin <<a href="mailto:avagin@virtuozzo.com">avagin@virtuozzo.com</a>>:<br>
> > ><br>
> > > > Hi Radostin,<br>
> > > ><br>
> > > > Should we run this test in scripts/travis/travis-tests?<br>
> > > ><br>
> > > > Rodrigo has patches, which reworks image proxy & cache to a single<br>
> > > > thread model. These patches are mostly ready to be merged, but need<br>
> > > > some work.<br>
> > > ><br>
> > > > Would it be interesting for you to finish criu --remote, that we could<br>
> > > > merge it into the master branch?<br>
> > > ><br>
> > > > For that, all tests have to pass, and image and cache have to<br>
> > > > be single-thread processes.<br>
> > > ><br>
> > > > There is one inline comment.<br>
> > > ><br>
> > > > On Mon, Feb 12, 2018 at 10:54:05AM +0000, Radostin Stoyanov wrote:<br>
> > > > > Signed-off-by: Radostin Stoyanov <<a href="mailto:rstoyanov1@gmail.com">rstoyanov1@gmail.com</a>><br>
> > > > > ---<br>
> > > > > test/others/rpc/remote.py | 86 ++++++++++++++++++++++++++++++<br>
> > > > +++++++++++++++++<br>
> > > > > test/others/rpc/run.sh | 26 ++++++++++++++<br>
> > > > > 2 files changed, 112 insertions(+)<br>
> > > > > create mode 100644 test/others/rpc/remote.py<br>
> > > > ><br>
> > > > > diff --git a/test/others/rpc/remote.py b/test/others/rpc/remote.py<br>
> > > > > new file mode 100644<br>
> > > > > index 00000000..96ce3e21<br>
> > > > > --- /dev/null<br>
> > > > > +++ b/test/others/rpc/remote.py<br>
> > > > > @@ -0,0 +1,86 @@<br>
> > > > > +#!/usr/bin/env python2<br>
> > > > > +<br>
> > > > > +import socket, os, imp, sys, errno, signal<br>
> > > > > +import rpc_pb2 as rpc<br>
> > > > > +import argparse<br>
> > > > > +<br>
> > > > > +MAX_MSG_SIZE = 1024<br>
> > > > > +<br>
> > > > > +parser = argparse.ArgumentParser(<wbr>description="Test --remote option<br>
> > > > using CRIU RPC")<br>
> > > > > +parser.add_argument('socket', type = str, help = "CRIU service<br>
> > socket")<br>
> > > > > +parser.add_argument('dir', type = str, help = "Directory where CRIU<br>
> > > > images should be placed")<br>
> > > > > +parser.add_argument('pid', type = int, help = "PID of process to be<br>
> > > > dumped")<br>
> > > > > +<br>
> > > > > +args = vars(parser.parse_args())<br>
> > > > > +<br>
> > > > > +# Connect to RPC socket<br>
> > > > > +s = socket.socket(socket.AF_UNIX, socket.SOCK_SEQPACKET)<br>
> > > > > +s.connect(args['socket'])<br>
> > > > > +<br>
> > > > > +# Open images-dir<br>
> > > > > +dir_fd = os.open(args['dir'], os.O_DIRECTORY)<br>
> > > > > +if dir_fd < 0:<br>
> > > > > + print "Failed to open dir %s" % args['dir']<br>
> > > > > + sys.exit(-1)<br>
> > > > > +<br>
> > > > > +# Prepare dump request<br>
> > > > > +req = rpc.criu_req()<br>
> > > > > +req.type = rpc.DUMP<br>
> > > > > +req.opts.remote = True<br>
> > > > > +req.opts.log_level = 4<br>
> > > > > +req.opts.pid = args['pid']<br>
> > > > > +req.opts.images_dir_fd = dir_fd<br>
> > > > > +<br>
> > > > > +# Send dump request<br>
> > > > > +s.send(req.SerializeToString(<wbr>))<br>
> > > > > +<br>
> > > > > +# Receive responce<br>
> > > > > +resp = rpc.criu_resp()<br>
> > > > > +resp.ParseFromString(s.recv(<wbr>MAX_MSG_SIZE))<br>
> > > > > +<br>
> > > > > +# Reconnect to RPC socket<br>
> > > > > +s.close()<br>
> > > > > +s = socket.socket(socket.AF_UNIX, socket.SOCK_SEQPACKET)<br>
> > > > > +s.connect(args['socket'])<br>
> > > > > +<br>
> > > > > +<br>
> > > > > +if resp.type != rpc.DUMP:<br>
> > > > > + print 'Unexpected dump msg type'<br>
> > > > > + sys.exit(-1)<br>
> > > > > +else:<br>
> > > > > + if resp.success:<br>
> > > > > + print 'Dump Success'<br>
> > > > > + else:<br>
> > > > > + print 'Dump Fail'<br>
> > > > > + sys.exit(-1)<br>
> > > > > +<br>
> > > > > +req = rpc.criu_req()<br>
> > > > > +req.type = rpc.RESTORE<br>
> > > > > +req.opts.remote = True<br>
> > > > > +req.opts.log_level = 4<br>
> > > > > +req.opts.images_dir_fd = dir_fd<br>
> > > > > +<br>
> > > > > +# Send restore request<br>
> > > > > +s.send(req.SerializeToString(<wbr>))<br>
> > > > > +<br>
> > > > > +# Receive response<br>
> > > > > +resp = rpc.criu_resp()<br>
> > > > > +resp.ParseFromString(s.recv(<wbr>MAX_MSG_SIZE))<br>
> > > > > +<br>
> > > > > +# Close RPC socket<br>
> > > > > +s.close()<br>
> > > > > +# Close fd of images dir<br>
> > > > > +os.close(dir_fd)<br>
> > > > > +<br>
> > > > > +if resp.type != rpc.RESTORE:<br>
> > > > > + print 'Unexpected restore msg type'<br>
> > > > > + sys.exit(-1)<br>
> > > > > +else:<br>
> > > > > + if resp.success:<br>
> > > > > + print 'Restore success'<br>
> > > > > + print "PID of the restored program is %d\n" %<br>
> > > > (resp.restore.pid)<br>
> > > > > + # Kill restored process<br>
> > > > > + os.kill(resp.restore.pid, signal.SIGTERM)<br>
> > > > > + else:<br>
> > > > > + print 'Restore fail'<br>
> > > > > + sys.exit(-1)<br>
> > > > > diff --git a/test/others/rpc/run.sh b/test/others/rpc/run.sh<br>
> > > > > index ed99addb..5364cc90 100755<br>
> > > > > --- a/test/others/rpc/run.sh<br>
> > > > > +++ b/test/others/rpc/run.sh<br>
> > > > > @@ -76,6 +76,31 @@ function test_errno {<br>
> > > > > setsid ./errno.py build/criu_service.socket build/imgs_errno <<br>
> > > > /dev/null &>> build/output_errno<br>
> > > > > }<br>
> > > > ><br>
> > > > > +function test_remote {<br>
> > > > > + mkdir -p build/imgs_remote<br>
> > > > > +<br>
> > > > > + title_print "Run image-cache"<br>
> > > > > + ${CRIU} image-cache -v4 -o dump-loop.log -D build/imgs_remote<br>
> > > > --port 9996 &<br>
> > > > > + CACHE_PID=${!}<br>
> > > > > +<br>
> > > > > + title_print "Run image-proxy"<br>
> > > > > + ${CRIU} image-proxy -v4 -o dump-loop.log -D build/imgs_remote<br>
> > > > --address localhost --port 9996 &<br>
> > > ><br>
> > > > How do you wait when image-cache creates a listen socket?<br>
> > > ><br>
> > > > > + PROXY_PID=${!}<br>
> > > > > +<br>
> > > > > + title_print "Run loop.sh"<br>
> > > > > + setsid ./loop.sh < /dev/null &> build/loop.log &<br>
> > > > > + LOOP_PID=${!}<br>
> > > > > + echo "Start loop with pid ${P}"<br>
> > > > > +<br>
> > > > > + title_print "Run dump/restore with --remote test"<br>
> > > > > + ./remote.py build/criu_service.socket build/imgs_remote $P <<br>
> > > > /dev/null &>> build/output_remote<br>
> > > > > +<br>
> > > > > + # Clean up on failure<br>
> > > > > + kill -SIGTERM ${LOOP_PID}<br>
> > > > > + kill -SIGTERM ${CACHE_PID}<br>
> > > > > + kill -SIGTERM ${PROXT_PID}<br>
> > > > > +}<br>
> > > > > +<br>
> > > > > trap 'echo "FAIL"; stop_server' EXIT<br>
> > > > ><br>
> > > > > start_server<br>
> > > > > @@ -85,6 +110,7 @@ test_py<br>
> > > > > test_restore_loop<br>
> > > > > test_ps<br>
> > > > > test_errno<br>
> > > > > +test_remote<br>
> > > > ><br>
> > > > > stop_server<br>
> > > > ><br>
> > > > > --<br>
> > > > > 2.14.3<br>
> > > > ><br>
> > > > > ______________________________<wbr>_________________<br>
> > > > > CRIU mailing list<br>
> > > > > <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
> > > > > <a href="https://lists.openvz.org/mailman/listinfo/criu" rel="noreferrer" target="_blank">https://lists.openvz.org/<wbr>mailman/listinfo/criu</a><br>
> > > ><br>
> ><br>
</div></div></blockquote></div><br></div>