lxd/container_lxc.go
func (c *containerLXC) deviceExistsInDevicesFolder(prefix string, path string) bool {
	relativeDestPath := strings.TrimPrefix(path, "/")
	devName := fmt.Sprintf("%s.%s", strings.Replace(prefix, "/", "-", -1), strings.Replace(relativeDestPath, "/", "-", -1))
	devPath := filepath.Join(c.DevicesPath(), devName)

	return shared.PathExists(devPath)
}
func (c *containerLXC) deviceExistsInDevicesFolder(prefix string, path string) bool {
	relativeDestPath := strings.TrimPrefix(path, "/")
	devName := fmt.Sprintf("%s.%s", strings.Replace(prefix, "/", "-", -1), strings.Replace(relativeDestPath, "/", "-", -1))
	devPath := filepath.Join(c.DevicesPath(), devName)

	return shared.PathExists(devPath)
}
func ( c * containerLXC ) deviceExistsInDevicesFolder ( prefix string , path string ) bool { relativeDestPath := strings . TrimPrefix ( path , " " ) devName := fmt . Sprintf ( " " , strings . Replace ( prefix , " " , " " , - 1 ) , strings . Replace ( relativeDestPath , " " , " " , - 1 ) ) devPath := filepath . Join ( c . DevicesPath ( ) , devName ) return shared . PathExists ( devPath ) }
// Check if the unix device already exists.
Check if the unix device already exists .