[lxc-devel] [lxd/master] Cleanup ModelRevision => FirmwareVersion

stgraber on Github lxc-bot at linuxcontainers.org
Mon Sep 16 20:53:01 UTC 2019


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/20190916/671cad3f/attachment.bin>
-------------- next part --------------
From b03b0eeac3287560a52ab82f95c3768eeb41beb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 16 Sep 2019 22:39:57 +0200
Subject: [PATCH 1/3] api: Update API extension description
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 doc/api-extensions.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/api-extensions.md b/doc/api-extensions.md
index a94285efce..5708222afe 100644
--- a/doc/api-extensions.md
+++ b/doc/api-extensions.md
@@ -837,4 +837,4 @@ Extends the disk resource API struct to include:
  - Drive RPM
  - Block size
  - Firmware version
- - Model revision
+ - Serial number

From 483920eb71534e9992c9956e473e8b3c901ac48a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 16 Sep 2019 22:40:40 +0200
Subject: [PATCH 2/3] shared/api: Drop ModelRevision (same as FirmwareVersion)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 shared/api/resource.go | 1 -
 1 file changed, 1 deletion(-)

diff --git a/shared/api/resource.go b/shared/api/resource.go
index 8b0be0220f..815e5a4b09 100644
--- a/shared/api/resource.go
+++ b/shared/api/resource.go
@@ -228,7 +228,6 @@ type ResourcesStorageDisk struct {
 	BlockSize       uint64 `json:"block_size" yaml:"block_size"`
 	FirmwareVersion string `json:"firmware_version,omitempty" yaml:"firmware_version,omitempty"`
 	RPM             uint64 `json:"rpm" yaml:"rpm"`
-	ModelRevision   string `json:"model_revision,omitempty" yaml:"model_revision,omitempty"`
 	Serial          string `json:"serial,omitempty" yaml:"serial,omitempty"`
 
 	Partitions []ResourcesStorageDiskPartition `json:"partitions" yaml:"partitions"`

From b1898fa326dadbb0437d547edcfccbdf42276617 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 16 Sep 2019 22:52:23 +0200
Subject: [PATCH 3/3] lxd/storage: Replace ModelRevision by FirmwareVersion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/resources/storage.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lxd/resources/storage.go b/lxd/resources/storage.go
index b62c4f8052..2e66e7274c 100644
--- a/lxd/resources/storage.go
+++ b/lxd/resources/storage.go
@@ -73,9 +73,9 @@ func storageAddDriveInfo(devicePath string, disk *api.ResourcesStorageDisk) erro
 			disk.Type = "sata"
 		}
 
-		// Model revision number
-		if udevProperties["E:ID_REVISION"] != "" && disk.ModelRevision == "" {
-			disk.ModelRevision = udevProperties["E:ID_REVISION"]
+		// Firmware version
+		if udevProperties["E:ID_REVISION"] != "" && disk.FirmwareVersion == "" {
+			disk.FirmwareVersion = udevProperties["E:ID_REVISION"]
 		}
 
 		// Serial number


More information about the lxc-devel mailing list