File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ static int detect_vm_device_tree(void) {
9898 r = read_one_line_file ("/proc/device-tree/hypervisor/compatible" , & hvtype );
9999 if (r == - ENOENT ) {
100100 _cleanup_closedir_ DIR * dir = NULL ;
101+ _cleanup_free_ char * compat = NULL ;
101102
102103 if (access ("/proc/device-tree/ibm,partition-name" , F_OK ) == 0 &&
103104 access ("/proc/device-tree/hmc-managed?" , F_OK ) == 0 &&
@@ -119,6 +120,14 @@ static int detect_vm_device_tree(void) {
119120 return VIRTUALIZATION_QEMU ;
120121 }
121122
123+ r = read_one_line_file ("/proc/device-tree/compatible" , & compat );
124+ if (r < 0 && r != - ENOENT )
125+ return r ;
126+ if (r >= 0 && streq (compat , "qemu,pseries" )) {
127+ log_debug ("Virtualization %s found in /proc/device-tree/compatible" , compat );
128+ return VIRTUALIZATION_QEMU ;
129+ }
130+
122131 log_debug ("No virtualization found in /proc/device-tree/*" );
123132 return VIRTUALIZATION_NONE ;
124133 } else if (r < 0 )
You can’t perform that action at this time.
0 commit comments