<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 15, 2014 at 11:03 AM, 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">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></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Hmm. The one you mentioned above seems to be another patchset which is different from this one. This is purely to fix a bug where trying to write <span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">default value of memory.limit_in_bytes causes unclean restoration. </span></div>
<div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_default"><font color="#000000" face="arial, sans-serif">Sorry If i am confused here.</font></div>
<div class="gmail_default"><font color="#000000" face="arial, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, sans-serif">--Ying</font></div><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">
<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>
<div class="">><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>
</div>> 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>
<div><div class="h5">> ---<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>
</div></div>> <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>
</blockquote></div><br></div></div>