[lxc-devel] [lxd/master] lxd/device/usb: Fix check for required USB device

monstermunchkin on Github lxc-bot at linuxcontainers.org
Fri Oct 16 06:38:18 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201015/527b9b7c/attachment.bin>
-------------- next part --------------
From f7fd7215344bb0d5d31d04307a0ba5d17e9bf0fc Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Fri, 16 Oct 2020 08:37:26 +0200
Subject: [PATCH] lxd/device/usb: Fix check for required USB device

This fixes the check for required USB devices for VMs.

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 lxd/device/usb.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/device/usb.go b/lxd/device/usb.go
index b8d9fe7e07..4c6efea101 100644
--- a/lxd/device/usb.go
+++ b/lxd/device/usb.go
@@ -172,7 +172,7 @@ func (d *usb) startVM() (*deviceConfig.RunConfig, error) {
 		}...)
 	}
 
-	if d.isRequired() && len(runConf.Mounts) <= 0 {
+	if d.isRequired() && len(runConf.USBDevice) <= 0 {
 		return nil, fmt.Errorf("Required USB device not found")
 	}
 


More information about the lxc-devel mailing list