mirror of
https://github.com/ashaduri/gsmartcontrol.git
synced 2026-09-25 05:15:33 +00:00
Detection of NVMe self-test support.
This commit is contained in:
@@ -167,8 +167,11 @@ bool SelfTest::is_supported() const
|
||||
return false; // not supported by nvme
|
||||
case TestType::ShortTest:
|
||||
case TestType::LongTest:
|
||||
// NVMe spec
|
||||
return true;
|
||||
{
|
||||
// Both short and long should be supported if the drive has a self-test log
|
||||
const StorageProperty p = drive_->get_property_repository().lookup_property("nvme_self_test_log/_tests_supported");
|
||||
return (!p.empty() && p.get_value<bool>());
|
||||
}
|
||||
}
|
||||
|
||||
} else if (drive_->get_detected_type() == StorageDeviceDetectedType::AtaAny
|
||||
|
||||
@@ -384,6 +384,17 @@ hz::ExpectedVoid<SmartctlParserError> SmartctlJsonNvmeParser::parse_section_self
|
||||
|
||||
bool section_properties_found = false;
|
||||
|
||||
// If nvme_self_test_log is present, the drive supports tests
|
||||
{
|
||||
StorageProperty p;
|
||||
p.set_name("nvme_self_test_log/_tests_supported", "nvme_self_test_log/_tests_supported", _("Self-tests supported"));
|
||||
p.section = StoragePropertySection::SelftestLog;
|
||||
// p.show_in_ui = false;
|
||||
p.value = get_node_exists(json_root_node, "nvme_self_test_log").value_or(false);
|
||||
add_property(p);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
StorageProperty p;
|
||||
p.set_name("nvme_self_test_log/current_self_test_operation/value/_decoded",
|
||||
|
||||
Reference in New Issue
Block a user