virt: detect dmi before cpuid

Virtualbox should be detected as 'oracle'. This used to work but broke
with commit:

    commit 75f86906c5
    Author: Lennart Poettering <lennart@poettering.net>
    Date:   Mon Sep 7 13:42:47 2015 +0200

    basic: rework virtualization detection API

We swap detection for dmi and cpuid, this fixes Virtualbox with KVM.
Hopefully it does not break anything else.
This commit is contained in:
Christian Hesse 2015-11-23 13:55:04 +01:00
parent 8a85b710aa
commit 050e65ada2
1 changed files with 2 additions and 2 deletions

View File

@ -269,13 +269,13 @@ int detect_vm(void) {
if (cached_found >= 0)
return cached_found;
r = detect_vm_cpuid();
r = detect_vm_dmi();
if (r < 0)
return r;
if (r != VIRTUALIZATION_NONE)
goto finish;
r = detect_vm_dmi();
r = detect_vm_cpuid();
if (r < 0)
return r;
if (r != VIRTUALIZATION_NONE)