[lxc-devel] [lxd/master] Fix device hotplug with major/minor set

stgraber on Github lxc-bot at linuxcontainers.org
Fri Dec 9 14:19:35 UTC 2016


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/20161209/3bc9e369/attachment.bin>
-------------- next part --------------
From 97c8671ef420088bdb78c065ab61e94bfad36fe8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 9 Dec 2016 15:19:09 +0100
Subject: [PATCH] Fix device hotplug with major/minor set
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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 40f8c3f..5561571 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -5064,8 +5064,10 @@ func (c *containerLXC) insertUnixDevice(m shared.Device) error {
 	}
 
 	dType := ""
-	if m["type"] != "" {
-		dType = m["type"]
+	if m["type"] == "unix-char" {
+		dType = "c"
+	} else if m["type"] == "unix-block" {
+		dType = "b"
 	}
 
 	if dType == "" || dMajor < 0 || dMinor < 0 {


More information about the lxc-devel mailing list