The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6906

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From e2aab9a60ceee3347c9af802cdbf9068af876161 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 19 Feb 2020 19:31:15 -0500
Subject: [PATCH] lxd/vm: Fix disk files and snap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/device/disk.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lxd/device/disk.go b/lxd/device/disk.go
index 0faf207996..9f10a0d157 100644
--- a/lxd/device/disk.go
+++ b/lxd/device/disk.go
@@ -391,17 +391,17 @@ func (d *disk) startVM() (*deviceConfig.RunConfig, error) 
{
                return &runConf, nil
        } else if d.config["source"] != "" {
                // This is a normal disk device or image.
-               if !shared.PathExists(d.config["source"]) {
+               if !shared.PathExists(shared.HostPath(d.config["source"])) {
                        return nil, fmt.Errorf("Cannot find disk source")
                }
 
-               if shared.IsDir(d.config["source"]) {
+               if shared.IsDir(shared.HostPath(d.config["source"])) {
                        return nil, fmt.Errorf("Only block devices and disk 
images can be attached to VMs")
                }
 
                runConf.Mounts = []deviceConfig.MountEntryItem{
                        {
-                               DevPath: d.config["source"],
+                               DevPath: shared.HostPath(d.config["source"]),
                                DevName: d.name,
                        },
                }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to