detect-virt: use /proc/device-tree
Kernel doc Documentation/ABI/testing/sysfs-firmware-ofw says that the /proc/device-tree symlink should be used, as opposed to directly accessing /sys/firmware/devicetree/base. The former is ABI, but not the later.
This commit is contained in:
parent
c87664fef4
commit
b8f1df8264
|
@ -106,7 +106,7 @@ static int detect_vm_devicetree(const char **_id) {
|
||||||
_cleanup_free_ char *hvtype = NULL;
|
_cleanup_free_ char *hvtype = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = read_one_line_file("/sys/firmware/devicetree/base/hypervisor/compatible", &hvtype);
|
r = read_one_line_file("/proc/device-tree/hypervisor/compatible", &hvtype);
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
if (streq(hvtype, "linux,kvm")) {
|
if (streq(hvtype, "linux,kvm")) {
|
||||||
*_id = "kvm";
|
*_id = "kvm";
|
||||||
|
|
Loading…
Reference in a new issue