<div dir="ltr"><div>Sorry in advance, but I faced design problem here and not sure how to fix it.</div><div><br></div>For string sysctl with enum SysctlEntry.type is __CTL_STR but in sysctl_op req.type should already be CTL_STR(INET6_ADDRSTRLEN).<div><br></div><div>With current design req.type should be set in net_conf_op as there we do conf[i] -> req[ri] mapping, but in these place we already are general and can face ipv4/ipv6(or may be some other sysctls in future) so we can't hardcode type len here. Two ways are possible: 1) leave int in protobuf to have length at hand from the begging 2) change proto of net_conf_op to receive type length somethere else(not in SysctlEntry).</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><br>Best Regards, Tikhomirov Pavel.</div></div></div>
<br><div class="gmail_quote">2016-04-21 19:04 GMT+03:00 Pavel Tikhomirov <span dir="ltr"><<a href="mailto:ptikhomirov@virtuozzo.com" target="_blank">ptikhomirov@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="">int32 with boolean value in protobuf has the same size with bool,<br>
many sysctls are boolean but we don't lose anything by storing them<br>
in int32, so add only int32 and string fields<br>
<br>
will need string field for stable_secret ipv6 sysctl<br>
<br>
also such fromat allows us to easily handle non-present sysctls<br>
we can check if we have it using has_*arg<br>
<br>
v3: rebase images/Makefile to criu-dev branch<br>
</span>v4: use enum for type<br>
<span class="">Signed-off-by: Pavel Tikhomirov <<a href="mailto:ptikhomirov@virtuozzo.com">ptikhomirov@virtuozzo.com</a>><br>
---<br>
images/Makefile | 1 +<br>
images/netdev.proto | 6 ++++++<br>
</span> images/sysctl.proto | 11 +++++++++++<br>
3 files changed, 18 insertions(+)<br>
<div><div class="h5"> create mode 100644 images/sysctl.proto<br>
<br>
diff --git a/images/Makefile b/images/Makefile<br>
index 52f516e..b5a2804 100644<br>
--- a/images/Makefile<br>
+++ b/images/Makefile<br>
@@ -59,6 +59,7 @@ proto-obj-y += seccomp.o<br>
proto-obj-y += binfmt-misc.o<br>
proto-obj-y += time.o<br>
proto-obj-y += autofs.o<br>
+proto-obj-y += sysctl.o<br>
<br>
CFLAGS += -iquote $(obj)/<br>
<br>
diff --git a/images/netdev.proto b/images/netdev.proto<br>
index dafa2bd..ce0daeb 100644<br>
--- a/images/netdev.proto<br>
+++ b/images/netdev.proto<br>
@@ -1,5 +1,6 @@<br>
import "opts.proto";<br>
import "tun.proto";<br>
+import "sysctl.proto";<br>
<br>
enum nd_type {<br>
LOOPBACK = 1;<br>
@@ -31,9 +32,14 @@ message net_device_entry {<br>
optional bytes address = 7;<br>
<br>
repeated int32 conf = 8;<br>
+<br>
+ repeated sysctl_entry conf4 = 9;<br>
}<br>
<br>
message netns_entry {<br>
repeated int32 def_conf = 1;<br>
repeated int32 all_conf = 2;<br>
+<br>
+ repeated sysctl_entry def_conf4 = 3;<br>
+ repeated sysctl_entry all_conf4 = 4;<br>
}<br>
diff --git a/images/sysctl.proto b/images/sysctl.proto<br>
new file mode 100644<br>
</div></div>index 0000000..c64789a<br>
--- /dev/null<br>
+++ b/images/sysctl.proto<br>
@@ -0,0 +1,11 @@<br>
+enum SysctlType {<br>
+ __CTL_STR = 5;<br>
+ CTL_32 = 6;<br>
+}<br>
+<br>
+message sysctl_entry {<br>
+ required SysctlType type = 1;<br>
<span class="im HOEnZb">+<br>
+ optional int32 iarg = 2;<br>
+ optional string sarg = 3;<br>
+}<br>
</span><span class="HOEnZb"><font color="#888888">--<br>
1.9.3<br>
</font></span><div class="HOEnZb"><div class="h5"><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" rel="noreferrer" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
</div></div></blockquote></div><br></div>