]> git.ipfire.org Git - thirdparty/systemd.git/commit
basic/virt: provide a nicer message is /proc/cpuinfo is not available
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Feb 2018 11:49:15 +0000 (12:49 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Feb 2018 19:04:29 +0000 (20:04 +0100)
commitef2a48aa01b85a9d5cd827772b179a995855de62
treea48f30b6acfa63623d59b891c2bf237f781a7862
parenta2896612a3f7e1c1843df74dba9f9561647b7667
basic/virt: provide a nicer message is /proc/cpuinfo is not available

$ sudo systemd-run -p RootDirectory=/usr -E LD_LIBRARY_PATH=/lib/systemd/ -E SYSTEMD_LOG_LEVEL=debug /bin/systemd-detect-virt

Before
systemd-detect-virt[18498]: No virtualization found in DMI
systemd-detect-virt[18498]: No virtualization found in CPUID
systemd-detect-virt[18498]: Virtualization XEN not found, /proc/xen does not exist
systemd-detect-virt[18498]: This platform does not support /proc/device-tree
systemd-detect-virt[18498]: Failed to check for virtualization: No such file or directory

The first four lines are at debug level, so the user would only see that last
one usually, which is not very enlightening.

This now becomes:
systemd-detect-virt[21172]: No virtualization found in DMI
systemd-detect-virt[21172]: No virtualization found in CPUID
systemd-detect-virt[21172]: Virtualization XEN not found, /proc/xen does not exist
systemd-detect-virt[21172]: This platform does not support /proc/device-tree
systemd-detect-virt[21172]: /proc/cpuinfo not found, assuming no UML virtualization.
systemd-detect-virt[21172]: This platform does not support /proc/sysinfo
systemd-detect-virt[21172]: Found VM virtualization none
systemd-detect-virt[21172]: none

We do more checks, which is good too.
src/basic/virt.c