mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 20:02:38 +09:00
Bug #1046: detection of hypervisor fails for XEN
This commit is contained in:
1 parent
75fabe7861
commit
d7e05a46cf
1 file changed
+6
-3
@@ -116,13 +116,16 @@ class OpenNebulaNetwork
|
||||
end
|
||||
|
||||
def detect_hypervisor
|
||||
uname_a = `uname -a`
|
||||
lsmod = `#{COMMANDS[:lsmod]}`
|
||||
lsmod = `#{COMMANDS[:lsmod]}`
|
||||
xen_file = "/proc/xen/capabilities"
|
||||
xen_content = "control_d"
|
||||
|
||||
if uname_a.match(/xen/i)
|
||||
if File.readable?(xen_file) and File.read(xen_file).strip == xen_content
|
||||
"xen"
|
||||
elsif lsmod.match(/kvm/)
|
||||
"kvm"
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user