Do not redirect `systemd-detect-virt` to /dev/null, otherwise, the `vm` variable
is always empty. This function was working only thanks to the following /sys
check.
Reported-by: Raymund Will <rw@suse.com>
# 1 if a virt environment could not be detected
# 255 if any error was encountered
if type -P systemd-detect-virt > /dev/null 2>&1; then
- if ! vm=$(systemd-detect-virt --vm > /dev/null 2>&1); then
+ if ! vm=$(systemd-detect-virt --vm 2> /dev/null); then
return 255
fi
[[ $vm == "qemu" ]] && return 0