summaryrefslogtreecommitdiffstats
path: root/import-layers/meta-virtualization/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/meta-virtualization/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch')
-rw-r--r--import-layers/meta-virtualization/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch121
1 files changed, 121 insertions, 0 deletions
diff --git a/import-layers/meta-virtualization/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch b/import-layers/meta-virtualization/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch
new file mode 100644
index 000000000..5adb730c8
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch
@@ -0,0 +1,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