1
0

Check kvm permissions

This commit is contained in:
dump_stack() 2019-08-18 12:53:13 +00:00
parent 735256ff13
commit ddf2fc0d0b
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -162,6 +162,15 @@ func kvmExists() bool {
if _, err := os.Stat("/dev/kvm"); err != nil { if _, err := os.Stat("/dev/kvm"); err != nil {
return false return false
} }
file, err := os.OpenFile("/dev/kvm", os.O_WRONLY, 0666)
if err != nil {
if os.IsPermission(err) {
return false
}
}
file.Close()
return true return true
} }