MCPcopy Create free account
hub / github.com/apache/cloudstack / check_kvm

Function check_kvm

python/lib/cloud_utils.py:297–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295
296#check function
297def check_kvm():
298 if distro in (Fedora,CentOS,RHEL6,SUSE):
299 if os.path.exists("/dev/kvm"): return True
300 raise CheckFailed("KVM is not correctly installed on this system, or support for it is not enabled in the BIOS")
301 else:
302 try:
303 kvmok()
304 return True
305 except CalledProcessError:
306 raise CheckFailed("KVM is not correctly installed on this system, or support for it is not enabled in the BIOS")
307 except OSError as e:
308 if e.errno == errno.ENOENT: raise CheckFailed("KVM is not correctly installed on this system, or support for it is not enabled in the BIOS")
309 raise
310 return True
311 raise AssertionError("check_kvm() should have never reached this part")
312
313def check_cgroups():
314 return glob.glob("/*/cpu.shares")

Callers

nothing calls this directly

Calls 2

CheckFailedClass · 0.85
existsMethod · 0.65

Tested by

no test coverage detected