<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">What I&#39;m not sure about is how this works with<br></span><span style="font-size:12.8px">--leave-running; doesn&#39;t it already delete these rules? If not, how is<br></span><span style="font-size:12.8px">the network actually unlocked?</span></blockquote><div> </div><div>cr-dump.c: (opts.final_state == TASK_ALIVE if <span style="font-size:12.8px">--leave-running is passed to criu)</span></div><div>1597     if (ret || post_dump_ret || opts.final_state == TASK_ALIVE) {</div><div>1598         network_unlock();</div><div>1599         delete_link_remaps();</div><div>1600     }</div><div><br></div><div>The only problem is that this 2 function calls are executed after dump and during restore.</div><div>And this calls expect already initialized big c/r state. It&#39;s the problem that I&#39;ve described in the previous email.</div><div><br></div><div>Also there is a pecularity in criu gc that can be important for you. You need to specify path to image<br></div><div>files dir for criu gc because criu gc uses data from images to find the right iptable rules and link remaps.</div><div>So a part of dump should be stored on node you migrate from.</div><div><br></div><div><span style="font-size:12.8px;white-space:nowrap">Tycho, do you have any urgency in criu gc feature arrival?</span><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-16 17:17 GMT+03:00 Tycho Andersen <span dir="ltr">&lt;<a href="mailto:tycho.andersen@canonical.com" target="_blank">tycho.andersen@canonical.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, May 16, 2016 at 03:31:57PM +0300, Pavel Emelyanov wrote:<br>
&gt; On 05/10/2016 08:04 PM, Tycho Andersen wrote:<br>
&gt; &gt; Hi guys,<br>
&gt; &gt;<br>
&gt; &gt; I&#39;m looking at implementing some kind of --leave-frozen option in<br>
&gt; &gt; CRIU, so that we can have a basic UX in LXD where we can wait for the<br>
&gt; &gt; restore to be successful before we kill the checkpointed container. I<br>
&gt; &gt; know p.haul does this by just using a callback, but it would be sort<br>
&gt; &gt; of painful to absorb just the callback part without doing a lot of<br>
&gt; &gt; extra engineering. We&#39;ll get LXD using p.haul someday, though :)<br>
&gt; &gt;<br>
&gt; &gt; The actual --leave-frozen patch is not so bad (see attached), but I&#39;m<br>
&gt; &gt; not sure what to do about the network locking/unlocking bits.<br>
&gt;<br>
&gt; There was a patch 8b04551c (restore: restore freezer cgroup state) in 2.0<br>
&gt; that turned cgroup into whatever state it was before dump. Can it be fixed<br>
&gt; to make &#39;--leave-frozen&#39; alter the behavior of add_freezer_state_for_restore()<br>
&gt; and set it to &#39;frozen&#39; always?<br>
<br>
</span>That&#39;s basically what this patch does, although in a slightly<br>
different way than what you suggest. I can fix it up if you want to<br>
apply it, though.<br>
<span class=""><br>
&gt; &gt; It seems like it is always safe to do the bits in<br>
&gt; &gt; cpt_unlock_tcp_connections() since that&#39;s just disabling tcp repair<br>
&gt; &gt; mode, but all of the iptables rules seem necessary in order to keep<br>
&gt; &gt; the network locked.<br>
&gt; &gt;<br>
&gt; &gt; So my question is: is there a nice way we can &quot;tag&quot; these rules so<br>
&gt; &gt; that something can come by and delete them later? I was thinking about<br>
&gt; &gt; having criu add a comment (via -m comment --comment &quot;CRIU-LOCK-RULE&quot;)<br>
&gt; &gt; to each rule it adds, but I&#39;m not sure if there&#39;s a better way, or if<br>
&gt; &gt; I&#39;ve missed something entirely.<br>
&gt;<br>
&gt; Yes, there&#39;s an issue #45 -- show what&#39;s left in the system after dump. Iptables<br>
&gt; rules are in the list :) I know that some gentlemen (Cc) from Saint-Petersburg were<br>
&gt; interested in implementing it in form of &#39;criu gc&#39; action, so probably tuning this<br>
&gt; option to support &#39;--show-only&#39; would help you?<br>
<br>
</span>Well, I could use `criu gc` directly to remove the iptables rules to<br>
unlock the network if that&#39;s all that was needed. So I don&#39;t really<br>
need a --show-only. What I&#39;m not sure about is how this works with<br>
--leave-running; doesn&#39;t it already delete these rules? If not, how is<br>
the network actually unlocked?<br>
<br>
I don&#39;t mind implementing such a `criu gc` option where it tries to go<br>
through and delete its rules, though. That sounds like exactly what I<br>
want here, and if it&#39;s ok with you, I can try to work on it :)<br>
<span class="HOEnZb"><font color="#888888"><br>
Tycho<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Best regards,<br>Eugene Batalov.</div>
</div>