mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-08 18:13:28 +00:00
Set testCPUInfoTemplate to systems /proc/cpuinfo and check if SMT is on/off only on P8 and lower systems as Power 9 systems support virtualization irrespective of SMT being on/off. Fixes: #1114 Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
25 lines
425 B
Go
25 lines
425 B
Go
// Copyright (c) 2018 IBM
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/sirupsen/logrus"
|
|
"io/ioutil"
|
|
)
|
|
|
|
var testCPUInfoTemplate = setTestCPUInfoTemplate()
|
|
|
|
func setTestCPUInfoTemplate() string {
|
|
|
|
var kataLog *logrus.Entry
|
|
content, err := ioutil.ReadFile("/proc/cpuinfo")
|
|
|
|
if err != nil {
|
|
kataLog.WithError(err).Error("failed to read file /proc/cpuinfo")
|
|
}
|
|
return string(content)
|
|
}
|