dcavalca / rpms / systemd

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