Commit 25ff73f6 authored by luchangqi.123's avatar luchangqi.123 Committed by Tomasz Zawadzki
Browse files

bdev/nvme: bdev_nvme_get_controller_health_info add critical_warning field



In spdk, we can use the rpc command bdev_nvme_get_controller_health_info to obtain disk hardware related information,
but the 'critical_warning' field is missed.

The 'critical_warning' field indicates critical warnings for the state of the controller. This field is very important in production,
which is used to determine whether the disk hardware is healthy.

Change-Id: I4d935ff65a6f7ea1adaf643c2ac523f2b7afbd15
Signed-off-by: default avatarluchangqi.123 <luchangqi.123@bytedance.com>
Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20355


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent 69f9c9ac
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1446,6 +1446,7 @@ get_health_log_page_completion(void *cb_arg, const struct spdk_nvme_cpl *cpl)
	spdk_str_trim(buf);
	spdk_json_write_named_string(w, "firmware_revision", buf);
	spdk_json_write_named_string(w, "traddr", trid->traddr);
	spdk_json_write_named_uint64(w, "critical_warning", health_page->critical_warning.raw);
	spdk_json_write_named_uint64(w, "temperature_celsius", health_page->temperature - 273);
	spdk_json_write_named_uint64(w, "available_spare_percentage", health_page->available_spare);
	spdk_json_write_named_uint64(w, "available_spare_threshold_percentage",