INNER CODE UNIT · JavaScript

checkKvm

NodeOS/NodeOS · lib/index.js:17

function checkKvm(qemuBin)
{
  let contents = ""

  try
  {
    contents = fs.readFileSync('/proc/cpuinfo')
  } catch(e){
    if(e.code !== 'ENOENT') throw(e)

    return false
  }

  if(! /(vmx|svm|0xc0f)/.test(contents)) return false

  // We have support for KVM, let's see if QEmu has permissions to use it
  try
  {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…