[lxc-devel] [lxd/master] lxd/containers: Fix unix devices with liblxc 3.1

stgraber on Github lxc-bot at linuxcontainers.org
Wed Dec 19 19:40:06 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181219/45b3eaad/attachment.bin>
-------------- next part --------------
From bc74733580d2c2951a1c7e5817af3e4a1d46e29d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 19 Dec 2018 14:39:50 -0500
Subject: [PATCH] lxd/containers: Fix unix devices with liblxc 3.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 64e9d86d64..9c0b93ce20 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -6663,7 +6663,7 @@ func (c *containerLXC) insertUnixDevice(prefix string, m types.Device, defaultMo
 		return fmt.Errorf("Failed to setup device: %s", err)
 	}
 	devPath := paths[0]
-	tgtPath := paths[1]
+	tgtPath := "/" + paths[1]
 
 	// Bind-mount it into the container
 	err = c.insertMount(devPath, tgtPath, "none", syscall.MS_BIND)


More information about the lxc-devel mailing list