]> git.ipfire.org Git - thirdparty/systemd.git/commit
virt: Properly detect nested UML inside another hypervisor
authorChristopher Obbard <chris.obbard@collabora.com>
Wed, 2 Dec 2020 14:20:39 +0000 (14:20 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Dec 2020 17:08:31 +0000 (18:08 +0100)
commit18453317ceda7cdf000a33050e1df32eb78b98cc
tree6c56441b5da49345c4844919e4503a6daa291ce1
parent2e304fb3db655871833e800274890133de99ad7f
virt: Properly detect nested UML inside another hypervisor

UML runs as a user-process so it can quite easily be ran inside of
another hypervisor, for instance inside a KVM instance. UML passes
through the CPUID from the host machine so in this case detect_vm
incorrectly identifies as running under KVM. So check we are running
a UML kernel first, before we check any other hypervisors.

Resolves: #17754

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
(cherry picked from commit c8037dbf05da586b6a210ac04f145d99f424971f)
src/basic/virt.c