From f6875b0a630cdcc6bb312f130ae92fc8becfb231 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 23 Nov 2015 19:15:25 +0100 Subject: virt: add comment about order in virtualization detection --- src/basic/virt.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/basic/virt.c b/src/basic/virt.c index a271c87333..b82680a54b 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -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; -- cgit v1.2.3-54-g00ecf