vzlist: do not use /proc/bc/resources for non-running CTs

For stopped CTs, UBC parameters should NOT be obtained from
/proc/bc/resources. Since /proc/bc/resources do not usually
list stopped CTs, this usually never happens.

In some rare cases though a container is stopped but for some
of its beancounters held value is not zero (such as because
of a kernel bug in UBC accounting), and its UBC entry remains.
In such a case, values from the proc file should not be used,
UBCs values (barrier and limit) should be obtained from the
CT config file. Otherwise we can have this:

 # vzlist 101 -o physpages.l
   PHYSP.L
    524288

 # vzctl set 101 --ram 10G --save
 CT configuration saved to /etc/vz/conf/101.conf

 # vzlist 101 -o physpages.l
   PHYSP.L
    524288  <<<<=== Old/wrong value shown here

 # vzctl start 101
 ...
 Container start in progress...

 # vzlist 101 -o physpages.l
   PHYSP.L
   2621440

http://bugzilla.openvz.org/2151

Reported-by: Ilja Livenson <ilja.livenson@gmail.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed