]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
virt: detect dmi before cpuid 1998/head
authorChristian Hesse <mail@eworm.de>
Mon, 23 Nov 2015 12:55:04 +0000 (13:55 +0100)
committerChristian Hesse <mail@eworm.de>
Mon, 23 Nov 2015 13:02:18 +0000 (14:02 +0100)
Virtualbox should be detected as 'oracle'. This used to work but broke
with commit:

    commit 75f86906c52735c98dc0aa7e24b773edb42ee814
    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.

src/basic/virt.c

index 1e5d6eea6e8b9b340f7e03187526efc5df4b138f..a271c87333e7f052794267fcb5f31c5bdb3b08bf 100644 (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)