[lxc-devel] [lxd/master] lxd/containers: Force bring up of SRIOV parent

stgraber on Github lxc-bot at linuxcontainers.org
Tue Sep 18 15:24:07 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180918/fdd64777/attachment.bin>
-------------- next part --------------
From d9616dbc4b0417f0a4e9e6bb77ae34eb1c7466d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 18 Sep 2018 17:19:28 +0200
Subject: [PATCH] lxd/containers: Force bring up of SRIOV parent
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #5041

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/container_lxc.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 08c5b74a78..728dd15dcf 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -7369,6 +7369,12 @@ func (c *containerLXC) fillSriovNetworkDevice(name string, m types.Device, reser
 		return nil, err
 	}
 
+	// Ensure parent is up (needed for Intel at least)
+	_, err = shared.RunCommand("ip", "link", "set", "dev", m["parent"], "up")
+	if err != nil {
+		return nil, err
+	}
+
 	// Check if any VFs are already enabled
 	nicName := ""
 	for i := 0; i < sriovNum; i++ {


More information about the lxc-devel mailing list