From a3358798d6bf8fec1369670499eba2c80fa350c7 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 2 Mar 2018 08:49:24 -0500 Subject: [PATCH] util/cutils: Rename qemu_strtosz() to qemu_strtosz_MiB() With qemu_strtosz(), no suffix means mebibytes. It's used rarely. I'm going to add a similar function where no suffix means bytes. Rename qemu_strtosz() to qemu_strtosz_MiB() to make the name qemu_strtosz() available for the new function. Backports commit e591591b323772eea733de6027f5e8b50692d0ff from qemu --- qemu/include/qemu/cutils.h | 2 +- qemu/util/cutils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/include/qemu/cutils.h b/qemu/include/qemu/cutils.h index 4cf6bea6..ce7243a8 100644 --- a/qemu/include/qemu/cutils.h +++ b/qemu/include/qemu/cutils.h @@ -144,9 +144,9 @@ int qemu_strtou64(const char *nptr, const char **endptr, int base, #define QEMU_STRTOSZ_DEFSUFFIX_MB 'M' #define QEMU_STRTOSZ_DEFSUFFIX_KB 'K' #define QEMU_STRTOSZ_DEFSUFFIX_B 'B' -int64_t qemu_strtosz(const char *nptr, char **end); int64_t qemu_strtosz_suffix(const char *nptr, char **end, const char default_suffix); +int64_t qemu_strtosz_MiB(const char *nptr, char **end); int64_t qemu_strtosz_metric(const char *nptr, char **end); #define K_BYTE (1ULL << 10) diff --git a/qemu/util/cutils.c b/qemu/util/cutils.c index 1cbb749a..f44b4754 100644 --- a/qemu/util/cutils.c +++ b/qemu/util/cutils.c @@ -203,7 +203,7 @@ int64_t qemu_strtosz_suffix(const char *nptr, char **end, return do_strtosz(nptr, end, default_suffix, 1024); } -int64_t qemu_strtosz(const char *nptr, char **end) +int64_t qemu_strtosz_MiB(const char *nptr, char **end) { return qemu_strtosz_suffix(nptr, end, QEMU_STRTOSZ_DEFSUFFIX_MB); }