fix #4165: SMART: add raw field

This makes it consistent with the naming scheme in PVE/GUI.
Keep value for API stability reasons, and remove it in next major version.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.cspak@proxmox.com>
This commit is contained in:
Matthias Heiserer 2022-07-21 12:45:57 +02:00 committed by Thomas Lamprecht
parent 37cfd7b336
commit 500014e83b

View File

@ -25,8 +25,11 @@ pub enum SmartStatus {
pub struct SmartAttribute {
/// Attribute name
name: String,
/// Attribute raw value
// fixme remove value in major release
/// duplicate of raw - kept for API stability
value: String,
/// Attribute raw value
raw: String,
// the rest of the values is available for ATA type
/// ATA Attribute ID
#[serde(skip_serializing_if = "Option::is_none")]
@ -146,7 +149,8 @@ pub fn get_smart_data(disk: &super::Disk, health_only: bool) -> Result<SmartData
attributes.push(SmartAttribute {
name,
value: raw_value,
value: raw_value.clone(),
raw: raw_value,
id: Some(id),
flags: Some(flags),
normalized: Some(normalized),
@ -180,6 +184,7 @@ pub fn get_smart_data(disk: &super::Disk, health_only: bool) -> Result<SmartData
attributes.push(SmartAttribute {
name: name.to_string(),
value: value.to_string(),
raw: value.to_string(),
id: None,
flags: None,
normalized: None,