| @@ 143-147 (lines=5) @@ | ||
| 140 | } |
|
| 141 | $buf=$this->grabkey('machdep.cpu.features'); |
|
| 142 | if (!is_null($buf) && (trim($buf) != "")) { |
|
| 143 | if (preg_match("/ VMX/", $buf)) { |
|
| 144 | $dev->setVirt("vmx"); |
|
| 145 | } elseif (preg_match("/ SVM/", $buf)) { |
|
| 146 | $dev->setVirt("svm"); |
|
| 147 | } |
|
| 148 | } |
|
| 149 | } |
|
| 150 | $dev->setCpuSpeed(round($this->grabkey('hw.cpufrequency') / 1000000)); |
|
| @@ 95-99 (lines=5) @@ | ||
| 92 | $_s = $arrBuff[1]; |
|
| 93 | break; |
|
| 94 | case 'flags': |
|
| 95 | if (preg_match("/ vmx/", $arrBuff[1])) { |
|
| 96 | $dev->setVirt("vmx"); |
|
| 97 | } elseif (preg_match("/ svm/", $arrBuff[1])) { |
|
| 98 | $dev->setVirt("svm"); |
|
| 99 | } |
|
| 100 | break; |
|
| 101 | } |
|
| 102 | } |
|