From nobody Thu Dec 18 04:29:02 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528400143243412.7999937742826; Thu, 7 Jun 2018 12:35:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D84873084035; Thu, 7 Jun 2018 19:35:41 +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 A42A12016A81; Thu, 7 Jun 2018 19:35:41 +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 602B74CA83; Thu, 7 Jun 2018 19:35:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w57JZcD1019078 for ; Thu, 7 Jun 2018 15:35:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 32CBA1001647; Thu, 7 Jun 2018 19:35:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27E8F1001646 for ; Thu, 7 Jun 2018 19:35:36 +0000 (UTC) Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 81F4137E7B for ; Thu, 7 Jun 2018 19:35:25 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id e11-v6so5235644pgq.0 for ; Thu, 07 Jun 2018 12:35:25 -0700 (PDT) Received: from centos.localdomain ([49.32.106.159]) by smtp.gmail.com with ESMTPSA id d23-v6sm86686407pfn.3.2018.06.07.12.35.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 12:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=K6H1G5yHMVYBH1fy4U29aqrrGIyG5i6tDYAAIlVSkoo=; b=hpzS6SDWfDc5hQc+vkPIMn0l4Ic1Hzrsh5FddI+CZFEcT2fXnxiVK0KvEWssy4KKnj uPmprrB6NHTpdMrn+GuApaDobaf8AaVBkdbUtsEHAUryNpKzDeOVcaZC9aWG5ePbIo1f HjRtVbQc7DhG+o6dBbIVLBO8uVS4CqNp5SeCDL25MHYlG3reKLJcpVi40quYWiRzJL+Y qNBS8Qs69pDqMNv5O+qOrcArlkh9f6Dqh3+F8HjsrvUH40pLZdRUmUib5O1N8xvurl8G CeCXwH3VwjVeyeS4Tpq3Il5fpNGIlMQme1M5jbrNCuXx92eexcuEZw7iyFpHv1c5hFlA oFaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=K6H1G5yHMVYBH1fy4U29aqrrGIyG5i6tDYAAIlVSkoo=; b=TyI0i+IWBHlaPgT2V4BKHuNaRWUWJRC5/BiGgycIa9xG6bZ4rKLHJ1l2jXoE8t8fyq b7k7A+PqQYntfRC4f9QXvvyQHpiOzk1Vqw1gZ0D8Shfd871z1t2KoYXtcbPLwbk60t1p EziNoZ4nVtmPccZvKiFtQfgscPj4sam8umYTCzjTYr3l1Ovmnd+4d2L1XW2GzzM4OUHA r0/WQdwRWeNNFwfxGDH2MWXG8++GoIRtiwgX/3//gQE/DUDj4fk+Ci2S6f2XHsX/v4L4 EaTUeZEVeEioPXLbBiMTO4GcLCrIPaUAUcj8c+9vIrIsvYDuNXMsJiPfSNngv1H+UQHX D3xQ== X-Gm-Message-State: APt69E3rZ2R68pr4MZgzRaaCBQzxTfckSqdcFhqveU5Gp1FM4WT3o8cl mHSHL0BHMUbE19/C7N4jX3rx4WWr X-Google-Smtp-Source: ADUXVKKHh2ZnpbYmwzXJhJTaPZAwXc8e0MTPbi2j8zVSxdf7SinC7Gcc5DM++aUvYh6thGtoTFogBw== X-Received: by 2002:a63:6ec8:: with SMTP id j191-v6mr2669054pgc.232.1528400124681; Thu, 07 Jun 2018 12:35:24 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Fri, 8 Jun 2018 01:04:36 +0530 Message-Id: <1528400083-6788-15-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1528400083-6788-1-git-send-email-skrtbhtngr@gmail.com> References: <1528400083-6788-1-git-send-email-skrtbhtngr@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 07 Jun 2018 19:35:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 07 Jun 2018 19:35:25 +0000 (UTC) for IP:'74.125.83.67' DOMAIN:'mail-pg0-f67.google.com' HELO:'mail-pg0-f67.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.281 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 74.125.83.67 mail-pg0-f67.google.com 74.125.83.67 mail-pg0-f67.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 14/21] util: json: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 07 Jun 2018 19:35:42 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Using the VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. --- src/util/virjson.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virjson.h b/src/util/virjson.h index e4a82bd..593dcb7 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -26,6 +26,7 @@ =20 # include "internal.h" # include "virbitmap.h" +# include "viralloc.h" =20 # include =20 @@ -45,6 +46,8 @@ typedef virJSONValue *virJSONValuePtr; void virJSONValueFree(virJSONValuePtr value); void virJSONValueHashFree(void *opaque, const void *name); =20 +VIR_DEFINE_AUTOPTR_FUNC(virJSONValuePtr, virJSONValueFree) + virJSONType virJSONValueGetType(const virJSONValue *value); =20 int virJSONValueObjectCreate(virJSONValuePtr *obj, ...) --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list