From 6532b64a07550dad459f00be1991036b983f1661 Mon Sep 17 00:00:00 2001 From: "Pradipta Kr. Banerjee" Date: Fri, 5 Jun 2015 14:25:59 +0530 Subject: [PATCH] Update netns to include support for PowerPC LE (ppc64le) architecture Current version of netns used in libnetwork do not have requisite syscall entry for PowerPC (ppc64le) arch. Consequently docker which uses libnetwork fails to create any network enabled containers on Power systems. This patch updates netns to latest commit 5478c060110032f972e86a1f844fdb9a2f008f2c to add ppc64le syscall entry. Signed-off-by: Pradipta Kr. Banerjee --- Godeps/Godeps.json | 2 +- .../src/github.com/vishvananda/netns/netns.go | 1 + .../src/github.com/vishvananda/netns/netns_linux.go | 2 ++ .../github.com/vishvananda/netns/netns_linux_386.go | 2 ++ .../{netns_linux_amd.go => netns_linux_amd64.go} | 2 ++ .../github.com/vishvananda/netns/netns_linux_arm.go | 2 ++ .../vishvananda/netns/netns_linux_ppc64le.go | 7 +++++++ .../vishvananda/netns/netns_unspecified.go | 12 ++++++------ 8 files changed, 23 insertions(+), 7 deletions(-) rename Godeps/_workspace/src/github.com/vishvananda/netns/{netns_linux_amd.go => netns_linux_amd64.go} (64%) create mode 100644 Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_ppc64le.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index c289309..f508c16 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -79,7 +79,7 @@ }, { "ImportPath": "github.com/vishvananda/netns", - "Rev": "008d17ae001344769b031375bdb38a86219154c6" + "Rev": "5478c060110032f972e86a1f844fdb9a2f008f2c" } ] } diff --git a/Godeps/_workspace/src/github.com/vishvananda/netns/netns.go b/Godeps/_workspace/src/github.com/vishvananda/netns/netns.go index 3878da3..2ca0fee 100644 --- a/Godeps/_workspace/src/github.com/vishvananda/netns/netns.go +++ b/Godeps/_workspace/src/github.com/vishvananda/netns/netns.go @@ -12,6 +12,7 @@ import ( "fmt" "syscall" ) + // NsHandle is a handle to a network namespace. It can be cast directly // to an int and used as a file descriptor. type NsHandle int diff --git a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux.go b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux.go index 1cf5e13..c9170d6 100644 --- a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux.go +++ b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux.go @@ -1,3 +1,5 @@ +// +build linux + package netns import ( diff --git a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_386.go b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_386.go index 0a6fe49..1d769bb 100644 --- a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_386.go +++ b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_386.go @@ -1,3 +1,5 @@ +// +build linux,386 + package netns const ( diff --git a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_amd.go b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_amd64.go similarity index 64% rename from Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_amd.go rename to Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_amd64.go index bbf3f4d..b124666 100644 --- a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_amd.go +++ b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_amd64.go @@ -1,3 +1,5 @@ +// +build linux,amd64 + package netns const ( diff --git a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_arm.go b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_arm.go index e35cb07..fbf165e 100644 --- a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_arm.go +++ b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_arm.go @@ -1,3 +1,5 @@ +// +build linux,arm + package netns const ( diff --git a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_ppc64le.go b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_ppc64le.go new file mode 100644 index 0000000..c49eba5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_ppc64le.go @@ -0,0 +1,7 @@ +// +build linux,ppc64le + +package netns + +const ( + SYS_SETNS = 350 +) diff --git a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_unspecified.go b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_unspecified.go index 42a804f..b2edc56 100644 --- a/Godeps/_workspace/src/github.com/vishvananda/netns/netns_unspecified.go +++ b/Godeps/_workspace/src/github.com/vishvananda/netns/netns_unspecified.go @@ -10,26 +10,26 @@ var ( ErrNotImplemented = errors.New("not implemented") ) -func Set(ns Namespace) (err error) { +func Set(ns NsHandle) (err error) { return ErrNotImplemented } -func New() (ns Namespace, err error) { +func New() (ns NsHandle, err error) { return -1, ErrNotImplemented } -func Get() (Namespace, error) { +func Get() (NsHandle, error) { return -1, ErrNotImplemented } -func GetFromName(name string) (Namespace, error) { +func GetFromName(name string) (NsHandle, error) { return -1, ErrNotImplemented } -func GetFromPid(pid int) (Namespace, error) { +func GetFromPid(pid int) (NsHandle, error) { return -1, ErrNotImplemented } -func GetFromDocker(id string) (Namespace, error) { +func GetFromDocker(id string) (NsHandle, error) { return -1, ErrNotImplemented }