From nobody Sun Feb 8 18:31:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1553866528872909.2921775275319; Fri, 29 Mar 2019 06:35:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 583E13092649; Fri, 29 Mar 2019 13:35:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 274B76B806; Fri, 29 Mar 2019 13:35:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D517E41F3F; Fri, 29 Mar 2019 13:35:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2TDXpUt026976 for ; Fri, 29 Mar 2019 09:33:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 916E817C70; Fri, 29 Mar 2019 13:33:51 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B67717C69 for ; Fri, 29 Mar 2019 13:33:50 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 29 Mar 2019 14:33:42 +0100 Message-Id: <1aa694c11d980f890ae7448f3d15faee54587331.1553866155.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] util: json: Export virJSONValueToBuffer X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 29 Mar 2019 13:35:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Laine Stump --- src/libvirt_private.syms | 1 + src/util/virjson.c | 4 ++-- src/util/virjson.h | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 73ef24d66f..7b9ea23ab9 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2202,6 +2202,7 @@ virJSONValueObjectKeysNumber; virJSONValueObjectRemoveKey; virJSONValueObjectStealArray; virJSONValueObjectStealObject; +virJSONValueToBuffer; virJSONValueToString; diff --git a/src/util/virjson.c b/src/util/virjson.c index 19857d2f2f..c519f8139e 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -1970,7 +1970,7 @@ virJSONValueToStringOne(virJSONValuePtr object, } -static int +int virJSONValueToBuffer(virJSONValuePtr object, virBufferPtr buf, bool pretty) @@ -2031,7 +2031,7 @@ virJSONValueFromString(const char *jsonstring ATTRIBU= TE_UNUSED) } -static int +int virJSONValueToBuffer(virJSONValuePtr object ATTRIBUTE_UNUSED, virBufferPtr buf ATTRIBUTE_UNUSED, bool pretty ATTRIBUTE_UNUSED) diff --git a/src/util/virjson.h b/src/util/virjson.h index 3dee103aba..ec86603794 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -26,6 +26,7 @@ # include "internal.h" # include "virbitmap.h" # include "viralloc.h" +# include "virbuffer.h" # include @@ -143,6 +144,10 @@ int virJSONValueArrayAppendString(virJSONValuePtr obje= ct, const char *value); virJSONValuePtr virJSONValueFromString(const char *jsonstring); char *virJSONValueToString(virJSONValuePtr object, bool pretty); +int virJSONValueToBuffer(virJSONValuePtr object, + virBufferPtr buf, + bool pretty) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; typedef int (*virJSONValueObjectIteratorFunc)(const char *key, virJSONValuePtr value, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list