r = read_one_line_file("/proc/device-tree/hypervisor/compatible", &hvtype);
if (r == -ENOENT) {
_cleanup_closedir_ DIR *dir = NULL;
+ _cleanup_free_ char *compat = NULL;
if (access("/proc/device-tree/ibm,partition-name", F_OK) == 0 &&
access("/proc/device-tree/hmc-managed?", F_OK) == 0 &&
return VIRTUALIZATION_QEMU;
}
+ r = read_one_line_file("/proc/device-tree/compatible", &compat);
+ if (r < 0 && r != -ENOENT)
+ return r;
+ if (r >= 0 && streq(compat, "qemu,pseries")) {
+ log_debug("Virtualization %s found in /proc/device-tree/compatible", compat);
+ return VIRTUALIZATION_QEMU;
+ }
+
log_debug("No virtualization found in /proc/device-tree/*");
return VIRTUALIZATION_NONE;
} else if (r < 0)