From 22951aaaebb6c4c314c58ad576960a9c57695bbc Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Fri, 12 May 2017 12:17:40 +0800 Subject: utils: provide size_to_str() Moving the algorithm from print_type_size() into size_to_str() so that other component can also leverage it. With that, refactor print_type_size(). The assert() in that logic is removed though, since even UINT64_MAX would not overflow. Signed-off-by: Peter Xu Message-Id: <1494562661-9063-3-git-send-email-peterx@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Dr. David Alan Gilbert --- include/qemu-common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/qemu-common.h b/include/qemu-common.h index d218821..387ef52 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -145,6 +145,7 @@ void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size); int parse_debug_env(const char *name, int max, int initial); const char *qemu_ether_ntoa(const MACAddr *mac); +char *size_to_str(uint64_t val); void page_size_init(void); /* returns non-zero if dump is in progress, otherwise zero is -- cgit v1.1