@@ -132,29 +132,42 @@ type BdevNvmeGetControllersRequest struct {
132132 Name string `json:"name,omitempty"`
133133}
134134
135- // type BdevNvmeControllerHealthInfo struct {
136- // ModelNumber string `json:"model_number"`
137- // SerialNumber string `json:"serial_number"`
138- // FirmwareRevision string `json:"firmware_revision"`
139- // Traddr string `json:"traddr"`
140- // TemperatureCelsius uint64 `json:"temperature_celsius"`
141- // AvailableSparePercentage uint64 `json:"available_spare_percentage"`
142- // AvailableSpareThresholdPercentage uint64 `json:"available_spare_threshold_percentage"`
143- // PercentageUsed uint64 `json:"percentage_used"`
144- // DataUnitsRead uint128 `json:"data_units_read"`
145- // DataUnitsWritten uint128 `json:"data_units_written"`
146- // HostReadCommands uint128 `json:"host_read_commands"`
147- // HostWriteCommands uint128 `json:"host_write_commands"`
148- // ControllerBusyTime uint128 `json:"controller_busy_time"`
149- // PowerCycles uint128 `json:"power_cycles"`
150- // PowerOnHours uint128 `json:"power_on_hours"`
151- // UnsafeShutdowns uint128 `json:"unsafe_shutdowns"`
152- // MediaErrors uint128 `json:"media_errors"`
153- // NumErrLogEntries uint128 `json:"num_err_log_entries"`
154- // WarningTemperatureTimeMinutes uint64 `json:"warning_temperature_time_minutes"`
155- // CriticalCompositeTemperatureTimeMinutes uint64 `json:"critical_composite_temperature_time_minutes"`
156- // }
157- //
158- // type BdevNvmeGetControllerHealthInfoRequest struct {
159- // Name string `json:"name"`
160- // }
135+ // UnknownTemperature represents an unknown/invalid NVMe temperature reading (in Celsius).
136+ // SPDK may emit an underflowed unsigned value when converting Kelvin to Celsius; map such
137+ // outliers to this sentinel at the client layer.
138+ const UnknownTemperature float64 = - 1
139+
140+ // BdevNvmeControllerHealthInfo represents the response of bdev_nvme_get_controller_health_info.
141+ type BdevNvmeControllerHealthInfo struct {
142+ ModelNumber string `json:"model_number"`
143+ SerialNumber string `json:"serial_number"`
144+ FirmwareRevision string `json:"firmware_revision"`
145+ Traddr string `json:"traddr"`
146+ CriticalWarning uint32 `json:"critical_warning"`
147+
148+ // TemperatureCelsius can sometimes be reported by SPDK as a wrapped 64-bit sentinel
149+ // value (e.g., 2^64 - 273) when temperature is invalid. Use float64 to avoid
150+ // unmarshal errors on oversized integers and let callers interpret outliers.
151+ TemperatureCelsius float64 `json:"temperature_celsius"`
152+
153+ AvailableSparePercentage uint32 `json:"available_spare_percentage"`
154+ AvailableSpareThresholdPercentage uint32 `json:"available_spare_threshold_percentage"`
155+ PercentageUsed uint32 `json:"percentage_used"`
156+ DataUnitsRead uint64 `json:"data_units_read"`
157+ DataUnitsWritten uint64 `json:"data_units_written"`
158+ HostReadCommands uint64 `json:"host_read_commands"`
159+ HostWriteCommands uint64 `json:"host_write_commands"`
160+ ControllerBusyTime uint64 `json:"controller_busy_time"`
161+ PowerCycles uint64 `json:"power_cycles"`
162+ PowerOnHours uint64 `json:"power_on_hours"`
163+ UnsafeShutdowns uint64 `json:"unsafe_shutdowns"`
164+ MediaErrors uint64 `json:"media_errors"`
165+ NumErrLogEntries uint64 `json:"num_err_log_entries"`
166+ WarningTemperatureTimeMinutes uint64 `json:"warning_temperature_time_minutes"`
167+ CriticalCompositeTemperatureTimeMinutes uint64 `json:"critical_composite_temperature_time_minutes"`
168+ }
169+
170+ // BdevNvmeGetControllerHealthInfoRequest is the request for fetching controller health.
171+ type BdevNvmeGetControllerHealthInfoRequest struct {
172+ Name string `json:"name"`
173+ }
0 commit comments