Re: [Qemu-devel] [PATCH v5 2/3] utils: provide size_to_str()

2017-05-09 Thread Peter Xu
On Tue, May 09, 2017 at 04:50:26PM +0200, Markus Armbruster wrote: > Peter Xu writes: > > > I stole the algorithm from print_type_size(). I didn't generalize it > > since that's using [KM...]iB while here we need [KM...]B to finally > > be able to stands for page sizes (and

Re: [Qemu-devel] [PATCH v5 2/3] utils: provide size_to_str()

2017-05-09 Thread Markus Armbruster
Peter Xu writes: > I stole the algorithm from print_type_size(). I didn't generalize it > since that's using [KM...]iB while here we need [KM...]B to finally > be able to stands for page sizes (and even more general). Can you explain why we need units without the 'i' here? >

[Qemu-devel] [PATCH v5 2/3] utils: provide size_to_str()

2017-05-09 Thread Peter Xu
I stole the algorithm from print_type_size(). I didn't generalize it since that's using [KM...]iB while here we need [KM...]B to finally be able to stands for page sizes (and even more general). Signed-off-by: Peter Xu --- include/qemu-common.h | 1 + util/cutils.c |