fix(inspur): show microcode version for every CPU, not just the first
Dedup by version caused CPU1 Microcode to be omitted when both CPUs run the same version, leaving the firmware column blank for the second socket. Each CPU gets its own firmware entry keyed by index. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
5
internal/parser/vendors/inspur/asset.go
vendored
5
internal/parser/vendors/inspur/asset.go
vendored
@@ -117,7 +117,6 @@ func ParseAssetJSON(content []byte, pcieSlotDeviceNames map[int]string, pcieSlot
|
||||
}
|
||||
|
||||
// Parse CPU info
|
||||
seenMicrocode := make(map[string]bool)
|
||||
for i, cpu := range asset.CpuInfo {
|
||||
config.CPUs = append(config.CPUs, models.CPU{
|
||||
Socket: i,
|
||||
@@ -133,13 +132,11 @@ func ParseAssetJSON(content []byte, pcieSlotDeviceNames map[int]string, pcieSlot
|
||||
PPIN: cpu.PPIN,
|
||||
})
|
||||
|
||||
// Add CPU microcode to firmware list (deduplicated)
|
||||
if cpu.MicroCodeVer != "" && !seenMicrocode[cpu.MicroCodeVer] {
|
||||
if cpu.MicroCodeVer != "" {
|
||||
config.Firmware = append(config.Firmware, models.FirmwareInfo{
|
||||
DeviceName: fmt.Sprintf("CPU%d Microcode", i),
|
||||
Version: cpu.MicroCodeVer,
|
||||
})
|
||||
seenMicrocode[cpu.MicroCodeVer] = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
internal/parser/vendors/inspur/component.go
vendored
4
internal/parser/vendors/inspur/component.go
vendored
@@ -102,7 +102,6 @@ func parseCPUInfo(text string, hw *models.HardwareConfig) {
|
||||
return
|
||||
}
|
||||
|
||||
seenMicrocode := make(map[string]bool)
|
||||
for _, proc := range cpuInfo.Processors {
|
||||
if proc.ProcStatus != 1 && proc.ConfigStatus != 1 {
|
||||
continue
|
||||
@@ -120,12 +119,11 @@ func parseCPUInfo(text string, hw *models.HardwareConfig) {
|
||||
TDP: proc.TDP,
|
||||
PPIN: proc.PPIN,
|
||||
})
|
||||
if proc.MicroCode != "" && !seenMicrocode[proc.MicroCode] {
|
||||
if proc.MicroCode != "" {
|
||||
hw.Firmware = append(hw.Firmware, models.FirmwareInfo{
|
||||
DeviceName: fmt.Sprintf("CPU%d Microcode", proc.ProcID),
|
||||
Version: proc.MicroCode,
|
||||
})
|
||||
seenMicrocode[proc.MicroCode] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user