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:
parent
ef8d3e2ce3
commit
3ec5aa3155
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user