summaryrefslogtreecommitdiffstats
path: root/import-layers/meta-virtualization/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch
blob: 5adb730c886f4bf43383084e3d9fdb64a430d868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
From e08f3573b3561f1f0490624f7ca95b7ccd8157cb Mon Sep 17 00:00:00 2001
Message-Id: <e08f3573b3561f1f0490624f7ca95b7ccd8157cb.1435177418.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Wed, 24 Jun 2015 16:16:38 -0400
Subject: [PATCH 1/1] Generate lxc-restore-net properly

It's a script that should be run through the configure
mechanism the same as the others.  We simply rename it
to have a .in extension and add it to configure.ac .

Also, by generating the script from a .in file, it gets
placed into the build directory.  This plays nice with
build systems that keep the src separate from the build
directory.  Without this change, the install step won't
find the lxc-restore-net script as it still just resides
in the src directory and not in the build directory.

Upstream-Status: Not applicable.  This script has already
been rearchitected out of existence by
cba98d127bf490b018a016b792ae05fd2d29c5ee:
"c/r: use criu option instead of lxc-restore-net

As of criu 1.5, the --veth-pair argument supports an additional parameter that
is the bridge name to attach to. This enables us to get rid of the goofy
action-script hack that passed bridge names as environment variables.

This patch is on top of the systemd/lxcfs mount rework patch, as we probably
want to wait to use 1.5 options until it has been out for a while and is in
distros.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>"

Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
 configure.ac               |  1 +
 src/lxc/lxc-restore-net    | 26 --------------------------
 src/lxc/lxc-restore-net.in | 26 ++++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 26 deletions(-)
 delete mode 100755 src/lxc/lxc-restore-net
 create mode 100755 src/lxc/lxc-restore-net.in

diff --git a/configure.ac b/configure.ac
index 574b2cd..4972803 100644
--- a/configure.ac
+++ b/configure.ac
@@ -768,6 +768,7 @@ AC_CONFIG_FILES([
 	src/lxc/legacy/lxc-ls
 	src/lxc/lxc.functions
 	src/lxc/version.h
+	src/lxc/lxc-restore-net
 	src/python-lxc/Makefile
 	src/python-lxc/setup.py
 
diff --git a/src/lxc/lxc-restore-net b/src/lxc/lxc-restore-net
deleted file mode 100755
index 6ae3c19..0000000
--- a/src/lxc/lxc-restore-net
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-set -e
-
-i=0
-while true; do
-	eval "bridge=\$LXC_CRIU_BRIDGE$i"
-	eval "veth=\$LXC_CRIU_VETH$i"
-
-	if [ -z "$bridge" ] || [ -z "$veth" ]; then
-		exit 0
-	fi
-
-	if [ "$CRTOOLS_SCRIPT_ACTION" = "network-lock" ]; then
-		brctl delif $bridge $veth
-	fi
-
-	if [ "$CRTOOLS_SCRIPT_ACTION" = "network-unlock" ]; then
-		brctl addif $bridge $veth
-		ip link set dev $veth up
-	fi
-
-	i=$((i+1))
-done
-
-exit 1
diff --git a/src/lxc/lxc-restore-net.in b/src/lxc/lxc-restore-net.in
new file mode 100755
index 0000000..6ae3c19
--- /dev/null
+++ b/src/lxc/lxc-restore-net.in
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+i=0
+while true; do
+	eval "bridge=\$LXC_CRIU_BRIDGE$i"
+	eval "veth=\$LXC_CRIU_VETH$i"
+
+	if [ -z "$bridge" ] || [ -z "$veth" ]; then
+		exit 0
+	fi
+
+	if [ "$CRTOOLS_SCRIPT_ACTION" = "network-lock" ]; then
+		brctl delif $bridge $veth
+	fi
+
+	if [ "$CRTOOLS_SCRIPT_ACTION" = "network-unlock" ]; then
+		brctl addif $bridge $veth
+		ip link set dev $veth up
+	fi
+
+	i=$((i+1))
+done
+
+exit 1
-- 
1.8.3.2

OpenPOWER on IntegriCloud