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

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 f1b9c49b14923d1e04b79dd86cdc6566755abe80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Thu, 9 Jul 2020 16:13:37 -0400
Subject: [PATCH] lxd/resources: Use udev model data if available
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 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lxd/resources/storage.go b/lxd/resources/storage.go
index d693441528..85ccfc9db6 100644
--- a/lxd/resources/storage.go
+++ b/lxd/resources/storage.go
@@ -74,16 +74,21 @@ func storageAddDriveInfo(devicePath string, disk 
*api.ResourcesStorageDisk) erro
                        disk.Type = "sata"
                }
 
-               // Firmware version
+               // Firmware version (if not found in sysfs)
                if udevProperties["E:ID_REVISION"] != "" && 
disk.FirmwareVersion == "" {
                        disk.FirmwareVersion = udevProperties["E:ID_REVISION"]
                }
 
                // Serial number
-               if udevProperties["E:ID_SERIAL_SHORT"] != "" && disk.Serial == 
"" {
+               if udevProperties["E:ID_SERIAL_SHORT"] != "" {
                        disk.Serial = udevProperties["E:ID_SERIAL_SHORT"]
                }
 
+               // Model number
+               if udevProperties["E:ID_MODEL"] != "" {
+                       disk.Model = udevProperties["E:ID_MODEL"]
+               }
+
                // Rotation per minute
                if udevProperties["E:ID_ATA_ROTATION_RATE_RPM"] != "" && 
disk.RPM == 0 {
                        valueUint, err := 
strconv.ParseUint(udevProperties["E:ID_ATA_ROTATION_RATE_RPM"], 10, 64)
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to