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

Bug #1046: Fix detection of hypervisor. A regular user can't read /proc/xen/capabilities

This commit is contained in:
Jaime Melis 2012-01-12 18:34:52 +01:00
parent ef8d3e2ce3
commit 3ec5aa3155

View File

@ -118,9 +118,8 @@ class OpenNebulaNetwork
def detect_hypervisor
lsmod = `#{COMMANDS[:lsmod]}`
xen_file = "/proc/xen/capabilities"
xen_content = "control_d"
if File.readable?(xen_file) and File.read(xen_file).strip == xen_content
if File.exists?(xen_file)
"xen"
elsif lsmod.match(/kvm/)
"kvm"