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
This commit is contained in:
Markus Armbruster 2018-03-02 08:49:24 -05:00 committed by Lioncash
parent f656cd91ec
commit a3358798d6
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 2 additions and 2 deletions

View file

@ -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)

View file

@ -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);
}