]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
virt: Support detection for ARM64 Hyper-V guests
authorBoqun Feng <boqun.feng@gmail.com>
Wed, 13 Oct 2021 03:32:09 +0000 (11:32 +0800)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Oct 2021 20:22:24 +0000 (22:22 +0200)
The detection of Microsoft Hyper-V VMs is done by cpuid currently,
however there is no cpuid on ARM64. And since ARM64 is now a supported
architecture for Microsoft Hyper-V guests[1], then use DMI tables to
detect a Hyper-V guest, which is more generic and works for ARM64.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467

src/basic/virt.c

index 745a8557795b8614d268b7f74a5e84a1a51f36b4..64581ad2e10d1c7cc6eba099979cd8ceef66fbd5 100644 (file)
@@ -165,6 +165,7 @@ static int detect_vm_dmi_vendor(void) {
                 { "Parallels",           VIRTUALIZATION_PARALLELS },
                 /* https://wiki.freebsd.org/bhyve */
                 { "BHYVE",               VIRTUALIZATION_BHYVE     },
+                { "Microsoft",           VIRTUALIZATION_MICROSOFT },
         };
         int r;