naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
6f381c
From 4b573adbcc040fa50f1130cb8cf1bdb9559565cf Mon Sep 17 00:00:00 2001
6f381c
From: Boqun Feng <boqun.feng@gmail.com>
6f381c
Date: Wed, 13 Oct 2021 11:32:09 +0800
6f381c
Subject: [PATCH] virt: Support detection for ARM64 Hyper-V guests
6f381c
6f381c
The detection of Microsoft Hyper-V VMs is done by cpuid currently,
6f381c
however there is no cpuid on ARM64. And since ARM64 is now a supported
6f381c
architecture for Microsoft Hyper-V guests[1], then use DMI tables to
6f381c
detect a Hyper-V guest, which is more generic and works for ARM64.
6f381c
6f381c
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467
6f381c
6f381c
(cherry picked from commit 506bbc8569014253ea8614b680ccbc4fc2513a87)
6f381c
6f381c
Resolves: #2158307
6f381c
---
6f381c
 src/basic/virt.c | 1 +
6f381c
 1 file changed, 1 insertion(+)
6f381c
6f381c
diff --git a/src/basic/virt.c b/src/basic/virt.c
6f381c
index 00d1c894e6..cc95097101 100644
6f381c
--- a/src/basic/virt.c
6f381c
+++ b/src/basic/virt.c
6f381c
@@ -162,6 +162,7 @@ static int detect_vm_dmi_vendor(void) {
6f381c
                 { "Parallels",     VIRTUALIZATION_PARALLELS },
6f381c
                 /* https://wiki.freebsd.org/bhyve */
6f381c
                 { "BHYVE",         VIRTUALIZATION_BHYVE     },
6f381c
+                { "Microsoft",           VIRTUALIZATION_MICROSOFT },
6f381c
         };
6f381c
         unsigned i;
6f381c
         int r;