Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca457ac72b |
@@ -218,6 +218,9 @@ func buildDevicesFromLegacy(hw *models.HardwareConfig) []models.HardwareDevice {
|
|||||||
if pcie.HWSlowdown != nil {
|
if pcie.HWSlowdown != nil {
|
||||||
details = mergeDetailMaps(details, map[string]any{"hw_slowdown": *pcie.HWSlowdown})
|
details = mergeDetailMaps(details, map[string]any{"hw_slowdown": *pcie.HWSlowdown})
|
||||||
}
|
}
|
||||||
|
if pcie.IOMMUGroup != nil {
|
||||||
|
details = mergeDetailMaps(details, map[string]any{"iommu_group": *pcie.IOMMUGroup})
|
||||||
|
}
|
||||||
present := pcie.Present
|
present := pcie.Present
|
||||||
appendDevice(models.HardwareDevice{
|
appendDevice(models.HardwareDevice{
|
||||||
Kind: models.DeviceKindPCIe,
|
Kind: models.DeviceKindPCIe,
|
||||||
@@ -844,6 +847,7 @@ func convertPCIeFromDevices(devices []models.HardwareDevice, collectedAt string)
|
|||||||
VendorID: d.VendorID,
|
VendorID: d.VendorID,
|
||||||
DeviceID: d.DeviceID,
|
DeviceID: d.DeviceID,
|
||||||
NUMANode: d.NUMANode,
|
NUMANode: d.NUMANode,
|
||||||
|
IOMMUGroup: intPtrFromDetailMap(d.Details, "iommu_group"),
|
||||||
TemperatureC: temperatureC,
|
TemperatureC: temperatureC,
|
||||||
PowerW: powerW,
|
PowerW: powerW,
|
||||||
LifeRemainingPct: floatFromDetailMap(d.Details, "life_remaining_pct"),
|
LifeRemainingPct: floatFromDetailMap(d.Details, "life_remaining_pct"),
|
||||||
@@ -2119,6 +2123,17 @@ func parseSocketFromSlot(slot string) int {
|
|||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func intPtrFromDetailMap(details map[string]any, key string) *int {
|
||||||
|
if details == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if _, ok := details[key]; !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
v := intFromDetailMap(details, key)
|
||||||
|
return &v
|
||||||
|
}
|
||||||
|
|
||||||
func intFromDetailMap(details map[string]any, key string) int {
|
func intFromDetailMap(details map[string]any, key string) int {
|
||||||
if details == nil {
|
if details == nil {
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ type ReanimatorPCIe struct {
|
|||||||
VendorID int `json:"vendor_id,omitempty"`
|
VendorID int `json:"vendor_id,omitempty"`
|
||||||
DeviceID int `json:"device_id,omitempty"`
|
DeviceID int `json:"device_id,omitempty"`
|
||||||
NUMANode int `json:"numa_node,omitempty"`
|
NUMANode int `json:"numa_node,omitempty"`
|
||||||
|
IOMMUGroup *int `json:"iommu_group,omitempty"`
|
||||||
TemperatureC float64 `json:"temperature_c,omitempty"`
|
TemperatureC float64 `json:"temperature_c,omitempty"`
|
||||||
PowerW float64 `json:"power_w,omitempty"`
|
PowerW float64 `json:"power_w,omitempty"`
|
||||||
LifeRemainingPct float64 `json:"life_remaining_pct,omitempty"`
|
LifeRemainingPct float64 `json:"life_remaining_pct,omitempty"`
|
||||||
|
|||||||
Reference in New Issue
Block a user