RWMJ: Update documentation and tests.
root=tests/linux-vserver
output="$(./virt-what --test-root=$root 2>&1)"
-expected="linux_vserver"
+expected="linux_vserver
+linux_vserver-guest"
if [ "$output" != "$expected" ]; then
echo "$0: test failed because output did not match expected"
# Check for Linux-VServer
if cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then
echo linux_vserver
+ if grep -q "VxID: 0$" "${root}/proc/self/status"; then
+ echo linux_vserver-host
+ else
+ echo linux_vserver-guest
+ fi
fi
# Check for UML.
=item B<linux_vserver>
+This is printed for backwards compatibility with older virt-what which
+could not distinguish between a Linux VServer container guest and
+host.
+
+=item B<linux_vserver-guest>
+
This process is running in a Linux VServer container.
Status: contributed by Barış Metin
+=item B<linux_vserver-host>
+
+This process is running as the Linux VServer host (VxID 0).
+
+Status: contributed by Barış Metin and Elan Ruusamäe
+
=item B<lxc>
This process is running in a Linux LXC container.