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