2017-12-13 0:23 GMT+02:00 Richard W.M. Jones <rjones@redhat.com>:
> Thanks: Mykola Ivanets

I have applied the patch and tested on latest stable release: 1.36.11 (actually version doesn't matter).
The problem gone.

The only note I'd like to stress that virt-df and df will have slightly different output
for such cases. Here is virt-df:

Filesystem             1K-blocks   Used  Available  Use%
disk.qcow2:/dev/sda1       99800      0      99799    1%

Here is df:

Filesystem     1K-blocks   Used Available Use%
/dev/sda1          99800      1     99800   1%

In both cases (used + available != total) block count. But inequality is in a different way.
The situation is the same with human-readable option: rounding is done differently.

I don't think virt-df must strickly mimic identical output from df.
It is more like informative tool: just quick check. If you need precise values - use statvfs.
And lastly, I guess that only file systems with block size < 1024 are affected.


--
    Nikolay Ivanets