On 9/24/18 5:09 PM, Eric Blake wrote:
> On 9/21/18 12:23 PM, Leonid Bloch wrote:
>> Adding a lookup table for the powers of two, with the appropriate size
>> prefixes. This is needed when a size has to be stringified, in which
>> case something like '(1 * KiB)' would become a literal '(1 * (1L << 10))'
>> string. Powers of two are used very often for sizes, so such a table
>> will also make it easier and more intuitive to write them.
> 
> Would it be better to provide a generic util function that takes an 
> arbitrary runtime value and converts it to a human-readable form?
> 

The problem is that the srtingification happens at compile time, and the 
literal string is written to qcow2.o (the default value). From here 
comes the need for this table. And the added benefit of it are more 
concise size notations for power-of-two sizes.

Leonid.

Reply via email to