[1/9] unix: image -- Shift mnt_id index

Submitted by Cyrill Gorcunov on Aug. 28, 2018, 1:21 p.m.

Details

Message ID 20180828132124.15697-2-gorcunov@gmail.com
State New
Series "unix: Add support for bindmounted dgram sockets"
Headers show

Commit Message

Cyrill Gorcunov Aug. 28, 2018, 1:21 p.m.
The index 17 is used in vz7 images, thus move it further to
avoid conflicts in future.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 criu/sk-unix.c       | 6 ++++++
 images/sk-unix.proto | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index c10ca9707f1f..59f4125476f9 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -2034,6 +2034,12 @@  static int init_unix_sk_info(struct unix_sk_info *ui, UnixSkEntry *ue)
 	ui->is_connected	= 0;
 	ui->peer_queue_restored = 0;
 
+	/* Compatibility with old images */
+	if (ui->ue->has_old_mnt_id) {
+		ui->ue->has_mnt_id = true;
+		ui->ue->mnt_id = ui->ue->old_mnt_id;
+	}
+
 	memzero(&ui->peer_resolve, sizeof(ui->peer_resolve));
 	memzero(&ui->d, sizeof(ui->d));
 
diff --git a/images/sk-unix.proto b/images/sk-unix.proto
index c59644f6eadd..fc033997a8a8 100644
--- a/images/sk-unix.proto
+++ b/images/sk-unix.proto
@@ -50,5 +50,9 @@  message unix_sk_entry {
 	optional bool			deleted		= 15;
 
 	optional uint32			ns_id		= 16;
-	optional sint32			mnt_id		= 17 [default = -1];
+	/*
+	 * field 17 is reserved for vz7 use
+	 */
+	optional sint32			old_mnt_id	= 17 [default = -1];
+	optional sint32			mnt_id		= 18 [default = -1];
 }