teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0141-detect-virt-use-proc-device-tree.patch

1ff636
From 436a001a5a28b9e3dd0988cc5a88bd3d7ec0acc8 Mon Sep 17 00:00:00 2001
1ff636
From: Andrew Jones <drjones@redhat.com>
1ff636
Date: Tue, 31 Mar 2015 11:08:11 +0200
1ff636
Subject: [PATCH] detect-virt: use /proc/device-tree
1ff636
1ff636
Kernel doc Documentation/ABI/testing/sysfs-firmware-ofw says that
1ff636
the /proc/device-tree symlink should be used, as opposed to
1ff636
directly accessing /sys/firmware/devicetree/base. The former is
1ff636
ABI, but not the later.
1ff636
1ff636
Cherry-picked from: b8f1df82646d2
1ff636
Resolves: #1207773
1ff636
---
1ff636
 src/shared/virt.c | 2 +-
1ff636
 1 file changed, 1 insertion(+), 1 deletion(-)
1ff636
1ff636
diff --git a/src/shared/virt.c b/src/shared/virt.c
1ff636
index 7c1381f..aa3501f 100644
1ff636
--- a/src/shared/virt.c
1ff636
+++ b/src/shared/virt.c
1ff636
@@ -106,7 +106,7 @@ static int detect_vm_devicetree(const char **_id) {
1ff636
         _cleanup_free_ char *hvtype = NULL;
1ff636
         int r;
1ff636
 
1ff636
-        r = read_one_line_file("/sys/firmware/devicetree/base/hypervisor/compatible", &hvtype);
1ff636
+        r = read_one_line_file("/proc/device-tree/hypervisor/compatible", &hvtype);
1ff636
         if (r >= 0) {
1ff636
                 if (streq(hvtype, "linux,kvm")) {
1ff636
                         *_id = "kvm";