Merge pull request #2593 from nubificus/fix_fc_vcpu_thread

virtcontainers: fc: parse vcpuID correctly
This commit is contained in:
Samuel Ortiz 2021-09-13 09:23:53 +02:00 committed by GitHub
commit 62a1a6f827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1170,7 +1170,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)
}