Discussion:
[lxc-devel] [lxd/master] Fix device hotplug with major/minor set
stgraber on Github
2016-12-09 14:19:36 UTC
Permalink
From 97c8671ef420088bdb78c065ab61e94bfad36fe8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <***@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 <***@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 {

Loading...