summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Schiffer <pschiffe@redhat.com>2014-02-05 12:44:15 +0100
committerPeter Schiffer <pschiffe@redhat.com>2014-02-05 12:44:15 +0100
commitee1797c50132e920d7ba134d070f6b76ddf9b3a2 (patch)
tree81aed317a02aa02951e2b4122add626393a90ab3 /src
parentcd4bea25e723050a829681e0b1d0ef964cc2f056 (diff)
downloadopenlmi-providers-ee1797c50132e920d7ba134d070f6b76ddf9b3a2.tar.gz
openlmi-providers-ee1797c50132e920d7ba134d070f6b76ddf9b3a2.tar.xz
openlmi-providers-ee1797c50132e920d7ba134d070f6b76ddf9b3a2.zip
Hardware: use unknown RPM value if real value is unavailable
Diffstat (limited to 'src')
-rw-r--r--src/hardware/LMI_DiskDriveProvider.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/hardware/LMI_DiskDriveProvider.c b/src/hardware/LMI_DiskDriveProvider.c
index ea2ea27..cfc9ef5 100644
--- a/src/hardware/LMI_DiskDriveProvider.c
+++ b/src/hardware/LMI_DiskDriveProvider.c
@@ -64,7 +64,7 @@ static CMPIStatus LMI_DiskDriveEnumInstances(
{
LMI_DiskDrive lmi_hdd;
const char *ns = KNameSpace(cop);
- unsigned i, j, rotational = 0;
+ unsigned i, j, rotational = 0, rpm;
unsigned long capacity = 0;
char instance_id[INSTANCE_ID_LEN], path[PATH_MAX], *name;
CMPIUint16 operational_status;
@@ -89,6 +89,9 @@ static CMPIStatus LMI_DiskDriveEnumInstances(
name = lsblk_hdds[i].name;
capacity = lsblk_hdds[i].capacity;
+ /* RPM value for unknown */
+ rpm = 0xffffffff;
+
LMI_DiskDrive_Init(&lmi_hdd, _cb, ns);
LMI_DiskDrive_Set_SystemCreationClassName(&lmi_hdd,
@@ -133,7 +136,7 @@ static CMPIStatus LMI_DiskDriveEnumInstances(
LMI_DiskDrive_Set_FormFactor(&lmi_hdd,
get_hdd_form_factor(smtcl_hdds[j].form_factor));
- LMI_DiskDrive_Set_RPM(&lmi_hdd, smtcl_hdds[j].rpm);
+ rpm = smtcl_hdds[j].rpm;
if (smtcl_hdds[j].port_speed) {
LMI_DiskDrive_Set_InterconnectSpeed(&lmi_hdd,
smtcl_hdds[j].port_speed);
@@ -156,7 +159,7 @@ static CMPIStatus LMI_DiskDriveEnumInstances(
} else if (rotational == 0) {
LMI_DiskDrive_Set_DiskType(&lmi_hdd,
LMI_DiskDrive_DiskType_Solid_State_Drive);
- LMI_DiskDrive_Set_RPM(&lmi_hdd, 0);
+ rpm = 0;
} else {
LMI_DiskDrive_Set_DiskType(&lmi_hdd,
LMI_DiskDrive_DiskType_Other);
@@ -166,6 +169,8 @@ static CMPIStatus LMI_DiskDriveEnumInstances(
LMI_DiskDrive_DiskType_Unknown);
}
+ LMI_DiskDrive_Set_RPM(&lmi_hdd, rpm);
+
if (lsblk_hdds[i].basename[0] == 'h') {
LMI_DiskDrive_Set_InterconnectType(&lmi_hdd,
LMI_DiskDrive_InterconnectType_ATA);