Paolo Bonzini e41b509d68 qapi: Refine human printing of sizes
This fixes several bugs or shortcomings of the previous pretty-printer.
In particular:

* use PRIu64 instead of casting to long long

* the exact value is included too

* the correct unit of measure (MiB, GiB, etc.) is used.  PiB and EiB
are added too.

* due to an off-by-one error, 512*2^30 was printed as 0.500MiB rather than
512MiB.  floor(log2(val)) is equal to 63 - clz(val), while the code used 64.

* The desired specification is %g rather than %f, which always uses three
decimals in the current code.  However %g would switch to scientific
notation when the integer part is >= 1000 (e.g. 1000*2^30).  To keep the
code simple, switch to the higher power when the integer part is >= 1000;
overflow is avoided by using frexp instead of clz.

Suggested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-02-14 21:12:05 +01:00
2013-04-18 13:50:53 +02:00
2013-07-09 13:38:56 -05:00
2013-08-07 12:48:00 -05:00
2014-02-14 21:12:05 +01:00
2013-11-25 20:35:28 -08:00
…
2013-12-02 21:02:57 +04:00
2013-10-11 09:34:56 -07:00
2013-09-05 09:40:31 -05:00
2014-01-08 19:07:20 +00:00
…
2013-10-11 10:52:54 +02:00
2013-10-11 09:34:56 -07:00
…
2014-02-11 22:56:37 +10:00
2014-02-11 22:56:37 +10:00
2013-11-04 15:39:41 +02:00
2013-07-23 02:41:31 +02:00
2013-08-12 09:15:12 -05:00
2014-02-09 09:12:38 +01:00
2013-09-03 12:25:55 +02:00
2014-01-24 17:40:03 +01:00
2014-02-01 13:46:06 +04:00
2013-12-04 15:19:00 +01:00
2013-12-04 15:19:00 +01:00
2013-07-19 12:52:03 +04:00
2013-10-11 09:34:56 -07:00
2013-09-25 21:23:05 +02:00
…
2013-11-27 14:02:45 -08:00
2013-10-11 09:34:56 -07:00
…

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
S
Description
Original Xbox Emulator for Windows, macOS, and Linux (Active Development)
Readme GPL-2.0
721 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 82.3%
C++ 6.9%
Python 3.5%
Dylan 2.7%
Shell 1.5%
Other 2.9%