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

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) ===

From 7d4c992dcb0dc5a20268bf57c13c88dc8e9e4df0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 30 Sep 2020 14:42:24 -0400
Subject: [PATCH 1/2] shared/api: Not all disks have a device path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 shared/api/resource.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shared/api/resource.go b/shared/api/resource.go
index 730537bdfd..edb590b7aa 100644
--- a/shared/api/resource.go
+++ b/shared/api/resource.go
@@ -253,7 +253,7 @@ type ResourcesStorageDisk struct {
        NUMANode  uint64 `json:"numa_node" yaml:"numa_node"`
 
        // API extension: resources_disk_sata
-       DevicePath      string `json:"device_path" yaml:"device_path"`
+       DevicePath      string `json:"device_path,omitempty" 
yaml:"device_path,omitempty"`
        BlockSize       uint64 `json:"block_size" yaml:"block_size"`
        FirmwareVersion string `json:"firmware_version,omitempty" 
yaml:"firmware_version,omitempty"`
        RPM             uint64 `json:"rpm" yaml:"rpm"`

From b8e81ae1080fed777f8c64bc3a0de740da1dd70e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 30 Sep 2020 17:29:41 -0400
Subject: [PATCH 2/2] lxd/resources: Ignore rbd devices
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/resources/storage.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lxd/resources/storage.go b/lxd/resources/storage.go
index c5ce8914b2..b051957f76 100644
--- a/lxd/resources/storage.go
+++ b/lxd/resources/storage.go
@@ -190,6 +190,11 @@ func GetStorage() (*api.ResourcesStorage, error) {
                                }
 
                                disk.Type = filepath.Base(diskSubsystem)
+
+                               if disk.Type == "rbd" {
+                                       // Ignore rbd devices as they aren't 
local block devices.
+                                       continue
+                               }
                        }
 
                        // Read-only
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to