In a container where the host's /proc is mounted and given by the HOST_PROC environment variable, what is host.Virtualization supposed to return ?
Is it supposed to give information about the host or about the container ?
The function checks a lot of files to get information, some about the host (eg. $HOST_PROC/cpuinfo) and some about the current process (which relate to the container, eg. $HOST_PROC/self/cgroup), which is inconsistent.
In particular when called inside an lxc container with HOST_PROC given then it will still show lxc (despite the host itself not being virtualized).
In a container where the host's
/proc
is mounted and given by theHOST_PROC
environment variable, what ishost.Virtualization
supposed to return ? Is it supposed to give information about the host or about the container ?The function checks a lot of files to get information, some about the host (eg.
$HOST_PROC/cpuinfo
) and some about the current process (which relate to the container, eg.$HOST_PROC/self/cgroup
), which is inconsistent.In particular when called inside an
lxc
container withHOST_PROC
given then it will still showlxc
(despite the host itself not being virtualized).