<div dir="ltr">Pavel,<div><br></div><div>The patch above is completely independent from the missing properties patches that I split into 2. Please merge this as it fixes a completely unrelated bug. </div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Aug 15, 2014 at 12:25 PM, Pavel Emelyanov <span dir="ltr"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 08/15/2014 11:15 PM, Serge Hallyn wrote:<br>
> That's going to be a painful thing to do item-by-item. One way to address<br>
> this - not urgent to do soon imo - would be to have the restart mark itself<br>
> as failed, but not immediately halt; have it write outa a file with all of<br>
> the absent features; Then the user edits that file marking all of the<br>
> ok-to-ignore things, and passes it in with a '--ignore-absent <file>'<br>
> argument, which criu then honors.<br>
<br>
</div>I like the idea to postpone the failure and ask the caller what to do.<br>
How about pushing the list of not found properties into the "post-restore"<br>
script letting it decide what to do next? Or even introduce yet another<br>
one, e.g. "cgroup-restore".<br>
<div><div class="h5"><br>
> Just a thought, but it seems like the only sane way to handle it.<br>
><br>
> Quoting Pavel Emelyanov (<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>):<br>
>> On 08/15/2014 08:54 PM, Ying Han wrote:<br>
>>> Ping?<br>
>><br>
>> We all agreed to commit the change that makes _dumping_ of absent properties<br>
>> non-fatal (I'll do that soon). As far as writing is concerned -- it looks like<br>
>> just ignoring the absence of properties from image dumps is not good as generic<br>
>> solution. Instead, for restore we need some fine-grained control over which<br>
>> properties to restore and which to ignore.<br>
>><br>
>> Thanks,<br>
>> Pavel<br>
>><br>
>><br>
>>><br>
>>><br>
>>> On Wed, Aug 13, 2014 at 11:59 AM, <<a href="mailto:gbellack@google.com">gbellack@google.com</a> <mailto:<a href="mailto:gbellack@google.com">gbellack@google.com</a>>> wrote:<br>
>>><br>
>>> From: Garrison Bellack <<a href="mailto:gbellack@google.com">gbellack@google.com</a> <mailto:<a href="mailto:gbellack@google.com">gbellack@google.com</a>>><br>
>>><br>
>>> When writing the system default for memory.limit_in_bytes (which is a LLONG_MAX)<br>
>>> the write fails. The number is equivalent to -1 (unlimited). So during dump,<br>
>>> store the number -1 instead.<br>
>>><br>
>>> Change-Id: Iafccc96bf5dbade763d7addaeda24194616e4d5f<br>
>>> Signed-off-by: Garrison Bellack <<a href="mailto:gbellack@google.com">gbellack@google.com</a> <mailto:<a href="mailto:gbellack@google.com">gbellack@google.com</a>>><br>
>>> ---<br>
>>> cgroup.c | 9 +++++++++<br>
>>> 1 file changed, 9 insertions(+)<br>
>>><br>
>>> diff --git a/cgroup.c b/cgroup.c<br>
>>> index 7ac2dd8..f8dbbde 100644<br>
>>> --- a/cgroup.c<br>
>>> +++ b/cgroup.c<br>
>>> @@ -288,6 +288,7 @@ static int read_cgroup_prop(struct cgroup_prop *property, const char *fpath)<br>
>>> {<br>
>>> char pbuf[PATH_MAX], buf[100];<br>
>>> FILE *f;<br>
>>> + char *endptr;<br>
>>><br>
>>> if (snprintf(pbuf, PATH_MAX, "%s/%s", fpath, property->name) >= PATH_MAX) {<br>
>>> pr_err("snprintf output was truncated");<br>
>>> @@ -315,6 +316,14 @@ static int read_cgroup_prop(struct cgroup_prop *property, const char *fpath)<br>
>>> return -1;<br>
>>> }<br>
>>><br>
>>> + if (strtoll(buf, &endptr, 10) == LLONG_MAX)<br>
>>> + strcpy(buf, "-1");<br>
>>> +<br>
>>> + if (strcmp(endptr, "\n")) {<br>
>>> + pr_perror("Failed parsing %s, with strtoll\n", buf);<br>
>>> + return -1;<br>
>>> + }<br>
>>> +<br>
>>> property->value = xstrdup(buf);<br>
>>> if (!property->value)<br>
>>> return -1;<br>
>>> --<br>
>>> 2.1.0.rc2.206.gedb03e5<br>
>>><br>
>>> _______________________________________________<br>
>>> CRIU mailing list<br>
>>> <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a> <mailto:<a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a>><br>
>>> <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
>>><br>
>>><br>
>><br>
>> _______________________________________________<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" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
</div></div>> .<br>
><br>
<br>
</blockquote></div><br></div>