From 32d7d2633fd832dcb52bd5fbdbb84bec700bc38d Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Fri, 18 Nov 2022 16:57:42 +0000 Subject: [PATCH] virt: Fix the detection for Hyper-V VMs --- ...rt-Fix-the-detection-for-Hyper-V-VMs.patch | 34 +++++++++++++++++++ ...t-detection-for-ARM64-Hyper-V-guests.patch | 24 ------------- SPECS/systemd.spec | 3 +- 3 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 SOURCES/1000-virt-Fix-the-detection-for-Hyper-V-VMs.patch delete mode 100644 SOURCES/1000-virt-Support-detection-for-ARM64-Hyper-V-guests.patch diff --git a/SOURCES/1000-virt-Fix-the-detection-for-Hyper-V-VMs.patch b/SOURCES/1000-virt-Fix-the-detection-for-Hyper-V-VMs.patch new file mode 100644 index 0000000..c3e28fa --- /dev/null +++ b/SOURCES/1000-virt-Fix-the-detection-for-Hyper-V-VMs.patch @@ -0,0 +1,34 @@ +From 4d5869f90a260329558e5ff157e56d7b918b5d08 Mon Sep 17 00:00:00 2001 +From: Andrew Lukoshko +Date: Fri, 18 Nov 2022 16:47:34 +0000 +Subject: [PATCH] virt: Fix the detection for Hyper-V VMs + +--- + src/basic/virt.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/basic/virt.c b/src/basic/virt.c +index d347732..390d0c5 100644 +--- a/src/basic/virt.c ++++ b/src/basic/virt.c +@@ -131,7 +131,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 { +@@ -149,6 +150,7 @@ static int detect_vm_dmi(void) { + { "Parallels", VIRTUALIZATION_PARALLELS }, + /* https://wiki.freebsd.org/bhyve */ + { "BHYVE", VIRTUALIZATION_BHYVE }, ++ { "Hyper-V", VIRTUALIZATION_MICROSOFT }, + }; + unsigned i; + int r; +-- +2.27.0 + diff --git a/SOURCES/1000-virt-Support-detection-for-ARM64-Hyper-V-guests.patch b/SOURCES/1000-virt-Support-detection-for-ARM64-Hyper-V-guests.patch deleted file mode 100644 index 7bc8ecd..0000000 --- a/SOURCES/1000-virt-Support-detection-for-ARM64-Hyper-V-guests.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 1411ffd6a63af4e71e9cf842727f0421d7ee92e6 Mon Sep 17 00:00:00 2001 -From: Andrew Lukoshko -Date: Wed, 1 Dec 2021 13:29:56 +0000 -Subject: [PATCH] virt: Support detection for ARM64 Hyper-V guests - ---- - src/basic/virt.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/basic/virt.c b/src/basic/virt.c -index 0b88005..5abba75 100644 ---- a/src/basic/virt.c -+++ b/src/basic/virt.c -@@ -155,6 +155,7 @@ static int detect_vm_dmi(void) { - { "Parallels", VIRTUALIZATION_PARALLELS }, - /* https://wiki.freebsd.org/bhyve */ - { "BHYVE", VIRTUALIZATION_BHYVE }, -+ { "Microsoft", VIRTUALIZATION_MICROSOFT }, - }; - unsigned i; - int r; --- -2.27.0 - diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index ca5eaec..1281755 100644 --- a/SPECS/systemd.spec +++ b/SPECS/systemd.spec @@ -884,7 +884,8 @@ Patch0831: 0831-logind-schedule-idle-check-full-interval-from-now-if.patch # https://github.com/systemd/systemd/pull/20998 -Patch1000: 1000-virt-Support-detection-for-ARM64-Hyper-V-guests.patch +# https://github.com/systemd/systemd/pull/21475 +Patch1000: 1000-virt-Fix-the-detection-for-Hyper-V-VMs.patch %ifarch %{ix86} x86_64 aarch64 %global have_gnu_efi 1