[Libguestfs] [PATCH] df: Handle block sizes smaller than 1024 bytes (RHBZ#1525241).

Nikolay Ivanets stenavin at gmail.com
Wed Dec 13 00:02:30 UTC 2017


2017-12-13 0:23 GMT+02:00 Richard W.M. Jones <rjones at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20171213/f05617a2/attachment.htm>


More information about the Libguestfs mailing list