]> git.ipfire.org Git - thirdparty/systemd.git/commit
virt: detect "linux,dummy-virt" devicetree VMs 36655/head
authorLennart Poettering <lennart@poettering.net>
Fri, 7 Mar 2025 10:57:43 +0000 (11:57 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 7 Mar 2025 14:18:08 +0000 (15:18 +0100)
commit600e135a0bfaa343a1b938632f61acb54e2abf58
treef221e670d99d1f7eacd03fb69cc86fdad5d1b8f3
parent4d53d76f5e040a4dc5749aa2c401607933b957e5
virt: detect "linux,dummy-virt" devicetree VMs

So apparently "linux,dummy-virt" is a devicetree in popular use by
various hypervisors, including crosvm:

https://github.com/google/crosvm/blob/e5d7a64d377d00b9b96bc026548769ab59cf216b/aarch64/src/fdt.rs#L692

and qemu:

https://github.com/qemu/qemu/blob/98c7362b1efe651327385a25874a73e008c6549e/hw/arm/virt.c#L283

and that's because the kernel ships support for that natively:

https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/linux%2Cdummy-virt.yaml

It's explicitly for using in virtualization. Hence it's suitable for
detecting it as generic fallback.

This hence adds the check, similar to how we already look for one other
qemu-specific devicetree.

I ran into this while playing around with the new Pixel "Linux Terminal"
app from google which runs a Debian in a crosvm apparently. So far
systemd didn't recognize execution in it at all. Let's at least
recognize it as VM at all, even if this doesn't recognize it as
crosvm.
src/basic/virt.c