1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

bug #3722: do not use modules to check for kvm

(cherry picked from commit 08b3b8c01ad4e73622214e9161ef6106e7d00954)
This commit is contained in:
Javi Fontan 2015-03-31 10:25:32 +02:00
parent d33ce04a33
commit 00764fccf4

View File

@ -81,12 +81,12 @@ module VNMMAD
# Return a string for the hypervisor
# @return [String] "kvm", "xen" or nil
def detect_hypervisor
lsmod = `#{VNMNetwork::COMMANDS[:lsmod]}`
xen_file = "/proc/xen/capabilities"
kvm_dir = "/sys/class/misc/kvm"
if File.exists?(xen_file)
"xen"
elsif lsmod.match(/kvm/)
elsif File.exists?(kvm_dir)
"kvm"
else
nil