mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-09 11:58:16 +00:00
Merge pull request #2593 from nubificus/fix_fc_vcpu_thread
virtcontainers: fc: parse vcpuID correctly
This commit is contained in:
commit
62a1a6f827
@ -1170,7 +1170,11 @@ func (fc *firecracker) getThreadIDs(ctx context.Context) (vcpuThreadIDs, error)
|
|||||||
if len(cpus) != 2 {
|
if len(cpus) != 2 {
|
||||||
return vcpuInfo, errors.Errorf("Invalid fc thread info: %v", comm)
|
return vcpuInfo, errors.Errorf("Invalid fc thread info: %v", comm)
|
||||||
}
|
}
|
||||||
cpuID, err := strconv.ParseInt(cpus[1], 10, 32)
|
|
||||||
|
//Remove the leading whitespace
|
||||||
|
cpuIdStr := strings.TrimSpace(cpus[1])
|
||||||
|
|
||||||
|
cpuID, err := strconv.ParseInt(cpuIdStr, 10, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return vcpuInfo, errors.Wrapf(err, "Invalid fc thread info: %v", comm)
|
return vcpuInfo, errors.Wrapf(err, "Invalid fc thread info: %v", comm)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user