diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:00:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:00:48 +0000 |
commit | f542925b701989ba6eed7b08b5226d4021b9b85f (patch) | |
tree | 57e14731f21a6d663326d30b7b88736e9d51c420 /debian/patches/virt-Fix-the-detection-for-Hyper-V-VMs.patch | |
parent | Adding upstream version 247.3. (diff) | |
download | systemd-8cfa7e7e684437c19d5798bdcb7baba512dd8f9e.tar.xz systemd-8cfa7e7e684437c19d5798bdcb7baba512dd8f9e.zip |
Adding debian version 247.3-7+deb11u4.debian/247.3-7+deb11u4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/virt-Fix-the-detection-for-Hyper-V-VMs.patch')
-rw-r--r-- | debian/patches/virt-Fix-the-detection-for-Hyper-V-VMs.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/debian/patches/virt-Fix-the-detection-for-Hyper-V-VMs.patch b/debian/patches/virt-Fix-the-detection-for-Hyper-V-VMs.patch new file mode 100644 index 0000000..9757987 --- /dev/null +++ b/debian/patches/virt-Fix-the-detection-for-Hyper-V-VMs.patch @@ -0,0 +1,38 @@ +From: Boqun Feng <boqun.feng@gmail.com> +Date: Tue, 23 Nov 2021 15:09:26 +0800 +Subject: virt: Fix the detection for Hyper-V VMs + +Use product_version instead of product_name in DMI table and the string +"Hyper-V" to avoid misdetection. + +Fixes: #21468 + +Signed-off-by: Boqun Feng <boqun.feng@gmail.com> +(cherry picked from commit 76eec0649936d9ae2f9087769f463feaf0cf5cb4) +--- + src/basic/virt.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/basic/virt.c b/src/basic/virt.c +index 0d45ee6..54befd9 100644 +--- a/src/basic/virt.c ++++ b/src/basic/virt.c +@@ -140,7 +140,8 @@ static int detect_vm_dmi(void) { + "/sys/class/dmi/id/product_name", /* Test this before sys_vendor to detect KVM over QEMU */ + "/sys/class/dmi/id/sys_vendor", + "/sys/class/dmi/id/board_vendor", +- "/sys/class/dmi/id/bios_vendor" ++ "/sys/class/dmi/id/bios_vendor", ++ "/sys/class/dmi/id/product_version" /* For Hyper-V VMs test */ + }; + + static const struct { +@@ -158,7 +159,7 @@ static int detect_vm_dmi(void) { + { "Parallels", VIRTUALIZATION_PARALLELS }, + /* https://wiki.freebsd.org/bhyve */ + { "BHYVE", VIRTUALIZATION_BHYVE }, +- { "Microsoft", VIRTUALIZATION_MICROSOFT }, ++ { "Hyper-V", VIRTUALIZATION_MICROSOFT }, + }; + unsigned i; + int r; |