mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 11:52:37 +09:00
bug #3722: use both lsmod and sys directory methods to check for kvm
This commit is contained in:
1 parent
08b3b8c01a
commit
9b343b02ed
1 file changed
+2
-1
@@ -81,12 +81,13 @@ 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 File.exists?(kvm_dir)
|
||||
elsif lsmod.match(/kvm/) || File.exists?(kvm_dir)
|
||||
"kvm"
|
||||
else
|
||||
nil
|
||||
|
||||
Reference in new issue
Block a user