virt: add comment about order in virtualization detection
authorChristian Hesse <mail@eworm.de>
Mon, 23 Nov 2015 18:15:25 +0000 (19:15 +0100)
committerChristian Hesse <mail@eworm.de>
Mon, 23 Nov 2015 18:15:25 +0000 (19:15 +0100)
src/basic/virt.c

index a271c87..b82680a 100644 (file)
@@ -269,6 +269,13 @@ int detect_vm(void) {
         if (cached_found >= 0)
                 return cached_found;
 
+        /* We have to use the correct order here:
+         * Some virtualization technologies do use KVM hypervisor but are
+         * expected to be detected as something else. So detect DMI first.
+         *
+         * An example is Virtualbox since version 5.0, which uses KVM backend.
+         * Detection via DMI works corretly, the CPU ID would find KVM
+         * only. */
         r = detect_vm_dmi();
         if (r < 0)
                 return r;