On 05/11/2018 08:25 PM, John Snow wrote:
The function already exists, just expose it.

Signed-off-by: John Snow <js...@redhat.com>
---
  include/qapi/qmp/qjson.h |  1 +
  qobject/qjson.c          | 21 +++++++++++----------
  2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h
index b274ac3a86..0e8624c1fa 100644
--- a/include/qapi/qmp/qjson.h
+++ b/include/qapi/qmp/qjson.h
@@ -19,6 +19,7 @@ QObject *qobject_from_jsonf(const char *string, ...) 
GCC_FMT_ATTR(1, 2);
  QObject *qobject_from_jsonv(const char *string, va_list *ap, Error **errp)
      GCC_FMT_ATTR(1, 0);
+QString *qobject_to_json_opt(const QObject *obj, int pretty, int indent);

pretty seems like it is better as a bool. Even though to_json() isn't typed correctly, that's no excuse for the public function to copy a bad interface (and maybe it's worth a separate cleanup patch to fix to_json() first).

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to