Merge pull request #2678 from nubificus/stable-2.2-fix_fc_vcpu_thread

stable-2.2 | virtcontainers: fc: parse vcpuID correctly
This commit is contained in:
Chelsea Mafrica 2021-09-20 09:46:07 -07:00 committed by GitHub
commit 484af1a559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1165,7 +1165,11 @@ func (fc *firecracker) getThreadIDs(ctx context.Context) (vcpuThreadIDs, error)
if len(cpus) != 2 {
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 {
return vcpuInfo, errors.Wrapf(err, "Invalid fc thread info: %v", comm)
}