qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, "John Snow" <jsnow@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Peter Xu" <peterx@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [Qemu-devel] [PULL 2/8] cutils: Move size_to_str() from "qemu-common.h" to "qemu/cutils.h"
Date: Thu, 19 Sep 2019 15:54:37 +0200	[thread overview]
Message-ID: <20190919135443.15164-3-laurent@vivier.eu> (raw)
In-Reply-To: <20190919135443.15164-1-laurent@vivier.eu>

From: Philippe Mathieu-Daudé <philmd@redhat.com>

"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>
---
 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 15f103026473..7ee2ee065d24 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"
 #include "block/qapi.h"
 #include "block/block_int.h"
 #include "block/throttle-groups.h"
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 0235cd3b912e..8d84db90b083 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.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);
 
 const char *qemu_ether_ntoa(const MACAddr *mac);
-char *size_to_str(uint64_t val);
 void page_size_init(void);
 
 /* returns non-zero if dump is in progress, otherwise zero is
diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h
index 12301340a474..b54c847e0fef 100644
--- a/include/qemu/cutils.h
+++ b/include/qemu/cutils.h
@@ -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_metric(const char *nptr, const char **end, uint64_t *result);
 
+char *size_to_str(uint64_t val);
+
 /* used to print char* safely */
 #define STR_OR_NULL(str) ((str) ? (str) : "null")
 
diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.c
index 7ab64468d9a5..0d93605d77a7 100644
--- a/qapi/string-output-visitor.c
+++ b/qapi/string-output-visitor.c
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/cutils.h"
 #include "qapi/string-output-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/host-utils.h"
-- 
2.21.0



  parent reply	other threads:[~2019-09-19 14:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19 13:54 [Qemu-devel] [PULL 0/8] Trivial branch patches Laurent Vivier
2019-09-19 13:54 ` [Qemu-devel] [PULL 1/8] vfio: fix a typo Laurent Vivier
2019-09-19 13:54 ` Laurent Vivier [this message]
2019-09-19 13:54 ` [Qemu-devel] [PULL 3/8] Replace '-machine accel=xyz' with '-accel xyz' Laurent Vivier
2019-09-19 13:54 ` [Qemu-devel] [PULL 4/8] target/m68k/fpu_helper.c: rename the access arguments Laurent Vivier
2019-09-19 13:54 ` [Qemu-devel] [PULL 5/8] build: Don't ignore qapi-visit-core.c Laurent Vivier
2019-09-19 13:54 ` [Qemu-devel] [PULL 6/8] Fix cacheline detection on FreeBSD/powerpc Laurent Vivier
2019-09-19 13:54 ` [Qemu-devel] [PULL 7/8] kvm: Fix typo in header of kvm_device_access() Laurent Vivier
2019-09-19 13:54 ` [Qemu-devel] [PULL 8/8] configure: Add xkbcommon configure options Laurent Vivier
2019-09-20 16:28 ` [Qemu-devel] [PULL 0/8] Trivial branch patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190919135443.15164-3-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=jsnow@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=peterx@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).