mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 01:43:39 +00:00
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>
This commit is contained in:
parent
f75ca62723
commit
31e404151b
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "qemu-common.h"
|
#include "qemu/cutils.h"
|
||||||
#include "block/qapi.h"
|
#include "block/qapi.h"
|
||||||
#include "block/block_int.h"
|
#include "block/block_int.h"
|
||||||
#include "block/throttle-groups.h"
|
#include "block/throttle-groups.h"
|
||||||
|
|
|
@ -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);
|
int parse_debug_env(const char *name, int max, int initial);
|
||||||
|
|
||||||
const char *qemu_ether_ntoa(const MACAddr *mac);
|
const char *qemu_ether_ntoa(const MACAddr *mac);
|
||||||
char *size_to_str(uint64_t val);
|
|
||||||
void page_size_init(void);
|
void page_size_init(void);
|
||||||
|
|
||||||
/* returns non-zero if dump is in progress, otherwise zero is
|
/* returns non-zero if dump is in progress, otherwise zero is
|
||||||
|
|
|
@ -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_MiB(const char *nptr, const char **end, uint64_t *result);
|
||||||
int qemu_strtosz_metric(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 */
|
/* used to print char* safely */
|
||||||
#define STR_OR_NULL(str) ((str) ? (str) : "null")
|
#define STR_OR_NULL(str) ((str) ? (str) : "null")
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "qemu-common.h"
|
#include "qemu/cutils.h"
|
||||||
#include "qapi/string-output-visitor.h"
|
#include "qapi/string-output-visitor.h"
|
||||||
#include "qapi/visitor-impl.h"
|
#include "qapi/visitor-impl.h"
|
||||||
#include "qemu/host-utils.h"
|
#include "qemu/host-utils.h"
|
||||||
|
|
Loading…
Reference in a new issue