vzlist: show diskspace/diskinodes usage/limit for ploop CTs
We are using information from /proc/vz/vzquota to show
diskspace and diskinodes usage and limits for CTs. Of course,
it is not working for ploop-based CTs.
So let's use ploop_info() for containers on ploop. Note that,
unlike vzquota, it works for stopped CTs as well.
BEFORE THIS PATCH:
# vzlist -o ctid,layout,status,diskspace,diskspace.h,diskinodes,diskinodes.h -a
CTID LAYOUT STATUS DSPACE DSPACE.H DINODES DINODES.H
200 simfs running 652348 2306867 24557 220000
201 simfs mounted 651504 2306867 24373 220000
202 simfs stopped - 2306867 - 220000
300 ploop running 0 2097152 0 220000
301 ploop stopped - 2097152 - 220000
AFTER THIS PATCH:
# vzlist -o ctid,layout,status,diskspace,diskspace.h,diskinodes,diskinodes.h -a
CTID LAYOUT STATUS DSPACE DSPACE.H DINODES DINODES.H
200 simfs running 652348 2306867 24557 220000
201 simfs mounted 651504 2306867 24373 220000
202 simfs stopped - 2306867 - 220000
300 ploop running 688092 2062160 24558 131072
301 ploop stopped 930564 2268760 24495 144288
Please note that for ploop,
1. Soft limit is the same as hard limit
2. Those are in fact not limits, but rather the actual characteristics
of the underlying file systems (same as df shows for this CT fs).
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed