[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH] cutils: Move size_to_str() from "q
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH] cutils: Move size_to_str() from "qemu-common.h" to "qemu/cutils.h" |
Date: |
Tue, 3 Sep 2019 14:57:31 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 9/3/19 8:05 AM, Philippe Mathieu-Daudé wrote:
> "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é <address@hidden>
> ---
> There are only 5 users, is it worthwhile renaming it qemu_sztostrt()?
(On the other hand, "size_to_str" is easy to read and "sztostrt" looks
like someone sneezed with their hand on the keyboard.)
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> block/qapi.c | 2 +-
> include/qemu-common.h | 1 -
> include/qemu/cutils.h | 2 ++
> qapi/string-output-visitor.c | 2 +-
> 4 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/block/qapi.c b/block/qapi.c
> index 15f1030264..7ee2ee065d 100644
> --- a/block/qapi.c
> +++ b/block/qapi.c
> @@ -23,7 +23,7 @@
> */
>
> #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/cutils.h"
I guess that's a more targeted inclusion. (That was the last thing we
needed in there?)
Seems proper. It must be an oversight to begin with that we declared it
in qemu-common but defined it in cutils.
Reviewed-by: John Snow <address@hidden>