diff mbox

[4/7] common: make get_human_readable_size public

Message ID 20170525152628.37628-5-vsementsov@virtuozzo.com
State New
Headers show

Commit Message

Vladimir Sementsov-Ogievskiy May 25, 2017, 3:26 p.m. UTC
To be reused from qemu-img check.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/qapi.c          | 2 +-
 include/qemu-common.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Eric Blake May 25, 2017, 5:57 p.m. UTC | #1
On 05/25/2017 10:26 AM, Vladimir Sementsov-Ogievskiy wrote:
> To be reused from qemu-img check.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>  block/qapi.c          | 2 +-
>  include/qemu-common.h | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)

Would it be better to use size_to_str() added in commit 22951aa?
diff mbox

Patch

diff --git a/block/qapi.c b/block/qapi.c
index a40922ea26..d249d97142 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -524,7 +524,7 @@  BlockStatsList *qmp_query_blockstats(bool has_query_nodes,
 
 #define NB_SUFFIXES 4
 
-static char *get_human_readable_size(char *buf, int buf_size, int64_t size)
+char *get_human_readable_size(char *buf, int buf_size, int64_t size)
 {
     static const char suffixes[NB_SUFFIXES] = {'K', 'M', 'G', 'T'};
     int64_t base;
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 387ef520bf..7102ad8dbd 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -152,4 +152,6 @@  void page_size_init(void);
  * returned. */
 bool dump_in_progress(void);
 
+char *get_human_readable_size(char *buf, int buf_size, int64_t size);
+
 #endif