From nobody Wed May 14 13:20:41 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1522853339145600.0009624085901; Wed, 4 Apr 2018 07:48:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3E3E820FD; Wed, 4 Apr 2018 14:48:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91C827EE16; Wed, 4 Apr 2018 14:48:57 +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 47857180BAE5; Wed, 4 Apr 2018 14:48:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w34Eg7hA020359 for ; Wed, 4 Apr 2018 10:42:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 90C2A215CDC6; Wed, 4 Apr 2018 14:42:07 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70BF52166BAE for ; Wed, 4 Apr 2018 14:42:07 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 21F19104522; Wed, 4 Apr 2018 16:42:02 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 4 Apr 2018 16:41:39 +0200 Message-Id: <09dd85e7930f2862e0b579d79e6dd219d2887e83.1522852107.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 50/68] util: Introduce virJSONValueObjectStealObject 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 04 Apr 2018 14:48:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/libvirt_private.syms | 1 + src/util/virjson.c | 8 ++++++++ src/util/virjson.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index f6897915ce..9d98ee54df 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2093,6 +2093,7 @@ virJSONValueObjectIsNull; virJSONValueObjectKeysNumber; virJSONValueObjectRemoveKey; virJSONValueObjectStealArray; +virJSONValueObjectStealObject; virJSONValueToString; =20 =20 diff --git a/src/util/virjson.c b/src/util/virjson.c index 3ddefc34ca..dfe00d9280 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -1400,6 +1400,14 @@ virJSONValueObjectStealArray(virJSONValuePtr object,= const char *key) } =20 =20 +virJSONValuePtr +virJSONValueObjectStealObject(virJSONValuePtr object, + const char *key) +{ + return virJSONValueObjectStealByType(object, key, VIR_JSON_TYPE_OBJECT= ); +} + + int virJSONValueObjectIsNull(virJSONValuePtr object, const char *key) diff --git a/src/util/virjson.h b/src/util/virjson.h index f7283dcf97..0f098892b4 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -112,6 +112,8 @@ virJSONValuePtr virJSONValueObjectGetArray(virJSONValue= Ptr object, const char *key); virJSONValuePtr virJSONValueObjectStealArray(virJSONValuePtr object, const char *key); +virJSONValuePtr virJSONValueObjectStealObject(virJSONValuePtr object, + const char *key); =20 const char *virJSONValueObjectGetString(virJSONValuePtr object, const char= *key); const char *virJSONValueObjectGetStringOrNumber(virJSONValuePtr object, co= nst char *key); --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list