[01/12,v2] images: add a network namespace id into images

Submitted by Andrei Vagin on March 22, 2017, 12:28 a.m.

Details

Message ID 1490142533-20654-2-git-send-email-avagin@openvz.org
State New
Series "Dump and restore internal veth devices"
Headers show

Commit Message

Andrei Vagin March 22, 2017, 12:28 a.m.
From: Andrei Vagin <avagin@virtuozzo.com>

It is possible to assign id for network namespaces and
this id will be used by the kernel in some netlink messages.
If no id is assigned when the kernel needs it, it will be
automatically assigned by the kernel.

For example, this id is reported for peer veth devices.

v2: add a comment
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 images/netdev.proto | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Patch hide | download patch | download mbox

diff --git a/images/netdev.proto b/images/netdev.proto
index 2f2f3d1..0d03b4c 100644
--- a/images/netdev.proto
+++ b/images/netdev.proto
@@ -42,6 +42,20 @@  message net_device_entry {
 	repeated sysctl_entry conf6	= 10;
 
 	optional macvlan_link_entry	macvlan		= 11;
+
+	optional uint32 peer_ifindex	= 12;
+	optional uint32 peer_nsid	= 13;
+}
+
+message netns_id {
+	/* This is CRIU's id which is allocated for each namespace */
+	required uint32	target_ns_id	= 1;
+	/*
+	 * This is an id which can be used to address this namespace
+	 * from another network namespace. Each network namespace has
+	 * one set of id-s for other namespaces.
+	 */
+	required int32	netnsid_value	= 2;
 }
 
 message netns_entry {
@@ -53,4 +67,6 @@  message netns_entry {
 
 	repeated sysctl_entry def_conf6	= 5;
 	repeated sysctl_entry all_conf6	= 6;
+
+	repeated netns_id nsids		= 7;
 }