qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

cutils: Move size_to_str() from "qemu-common.h" to "qemu/cutils.h"

"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>

authored by

Philippe Mathieu-Daudé and committed by
Laurent Vivier
31e40415 f75ca627

+4 -3
+1 -1
block/qapi.c
··· 23 23 */ 24 24 25 25 #include "qemu/osdep.h" 26 - #include "qemu-common.h" 26 + #include "qemu/cutils.h" 27 27 #include "block/qapi.h" 28 28 #include "block/block_int.h" 29 29 #include "block/throttle-groups.h"
-1
include/qemu-common.h
··· 123 123 int parse_debug_env(const char *name, int max, int initial); 124 124 125 125 const char *qemu_ether_ntoa(const MACAddr *mac); 126 - char *size_to_str(uint64_t val); 127 126 void page_size_init(void); 128 127 129 128 /* returns non-zero if dump is in progress, otherwise zero is
+2
include/qemu/cutils.h
··· 155 155 int qemu_strtosz_MiB(const char *nptr, const char **end, uint64_t *result); 156 156 int qemu_strtosz_metric(const char *nptr, const char **end, uint64_t *result); 157 157 158 + char *size_to_str(uint64_t val); 159 + 158 160 /* used to print char* safely */ 159 161 #define STR_OR_NULL(str) ((str) ? (str) : "null") 160 162
+1 -1
qapi/string-output-visitor.c
··· 11 11 */ 12 12 13 13 #include "qemu/osdep.h" 14 - #include "qemu-common.h" 14 + #include "qemu/cutils.h" 15 15 #include "qapi/string-output-visitor.h" 16 16 #include "qapi/visitor-impl.h" 17 17 #include "qemu/host-utils.h"