From nobody Thu May 15 09:32:01 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; 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 1523457809960408.22726076807055; Wed, 11 Apr 2018 07:43:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A676FC058EDD; Wed, 11 Apr 2018 14:43:28 +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 30978A099D; Wed, 11 Apr 2018 14:43:28 +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 D38F35BBFA; Wed, 11 Apr 2018 14:43:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3BEgGuq008841 for ; Wed, 11 Apr 2018 10:42:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 464A910B0F3B; Wed, 11 Apr 2018 14:42:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26DE710B0F3A for ; Wed, 11 Apr 2018 14:42:16 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id DB485100B88; Wed, 11 Apr 2018 16:42:10 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 11 Apr 2018 16:41:41 +0200 Message-Id: <9d01b8f7524e6e8117c336a2aea30d4878d27bf5.1523456480.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.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 51/73] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 11 Apr 2018 14:43:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=EF=BF=BDn Tomko --- 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 cab324c4d7..0918e69525 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2098,6 +2098,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