cutils: Move size_to_str() from "qemu-common.h" to "qemu/cutils.h"
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 3 Sep 2019 12:05:55 +0000 (14:05 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 19 Sep 2019 09:57:34 +0000 (11:57 +0200)
"qemu/cutils.h" contains various qemu_strtosz_*() functions
useful to convert strings to size. It seems natural to have
the opposite usage (from size to string) there too.

The function definition is already in util/cutils.c.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20190903120555.7551-1-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
block/qapi.c
include/qemu-common.h
include/qemu/cutils.h
qapi/string-output-visitor.c

index 15f1030264731e02453b9eb006e9d7da3c7b9e24..7ee2ee065d242b897e29e7b8cd15fe53c4592f4b 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/cutils.h"
 #include "block/qapi.h"
 #include "block/block_int.h"
 #include "block/throttle-groups.h"
index 0235cd3b912e4063d6aee7f82f7be7d3b3b96a43..8d84db90b0836c74a28d891c230e52e49735be4d 100644 (file)
@@ -123,7 +123,6 @@ 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
index 12301340a474df4f6515c11fa7841969c701ea16..b54c847e0fef8ec1d88f7503a4ed4041d192fbfe 100644 (file)
@@ -155,6 +155,8 @@ int qemu_strtosz(const char *nptr, const char **end, uint64_t *result);
 int qemu_strtosz_MiB(const char *nptr, const char **end, uint64_t *result);
 int qemu_strtosz_metric(const char *nptr, const char **end, uint64_t *result);
 
+char *size_to_str(uint64_t val);
+
 /* used to print char* safely */
 #define STR_OR_NULL(str) ((str) ? (str) : "null")
 
index 7ab64468d9a58a6a4529dba6a08435a17d07af36..0d93605d77a7a7852b556242a8b937b99322d54b 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/cutils.h"
 #include "qapi/string-output-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/host-utils.h"