virt: Fix Xen PV detection when nested inside another hypervisor
authorBogdan Seniuc <bogdan@bogdan.site>
Sat, 9 Oct 2021 12:00:36 +0000 (15:00 +0300)
committerLennart Poettering <lennart@poettering.net>
Mon, 11 Oct 2021 13:10:46 +0000 (15:10 +0200)
commit599be274c13c503806c85073d7beb1a155ac27bd
tree72b4f07f412ec88e87fb135ba11271041bcb5393
parenta6089431d52adda93eec251a3df0dffa1fe0661a
virt: Fix Xen PV detection when nested inside another hypervisor

Currently, when Xen PV domains are nested within a hypervisor which is
detected through CPUID (such as VMware), the detected hypervisor might
not be Xen, because we don't check for Xen until after the CPUID check.

This change moves the Xen check before CPUID checks to fix the issue,
and moves Dom0 checking to detect_vm_xen so that we keep ignoring Xen
when we are in Dom0.
src/basic/virt.c