From nobody Fri Jul 4 23:13:03 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 1530481493836284.8489194700169; Sun, 1 Jul 2018 14:44:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5342C0587EA; Sun, 1 Jul 2018 21:44:52 +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 9E66F30C43AE; Sun, 1 Jul 2018 21:44:52 +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 5CD493F64F; Sun, 1 Jul 2018 21:44:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w61Lij4n009209 for ; Sun, 1 Jul 2018 17:44:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 210E830C43AF; Sun, 1 Jul 2018 21:44:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1AB653083324 for ; Sun, 1 Jul 2018 21:44:42 +0000 (UTC) Received: from mail-pl0-f51.google.com (mail-pl0-f51.google.com [209.85.160.51]) (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 8C9B9C049D7F for ; Sun, 1 Jul 2018 21:44:31 +0000 (UTC) Received: by mail-pl0-f51.google.com with SMTP id d10-v6so6943334plo.5 for ; Sun, 01 Jul 2018 14:44:31 -0700 (PDT) Received: from centos.localdomain ([157.37.164.55]) by smtp.gmail.com with ESMTPSA id v68-v6sm15006933pfv.143.2018.07.01.14.44.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 14:44:30 -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=iCBeAnUK4EbV+bL3GoZNgVbdBYhCOBrahiFPxfCR2dI=; b=WUVmMQdOu+rXEkKbcX6NCgieh2Gc7ezcawV++2hmHuwm6NvKqtbaG97IiNLtbTiWRI iLQHy/KJZ1nDDo1wafjTl2a4CTi8WU1m5Qws78oSwH/kObCDKGRzgyG40tXJwJrCa9AF k1QFoo6U3qQmAI16bRYUr4oS6ilPwfOMtUvuQIH8n6HxYuDmC6TgIiubaJDCfUrw+C/+ D6GecGR8rJiFMbGejRn4KaQm0At9l3x6jwzNPmzYznQQCdQ/+GaJZ+QwexdWPSMtw2Fz FIiAAbe8O+3pARipvZ5ZE4BKw2dsRviYc+2YLQ1+yK9/tTDqgM7rCTE4j8961yio5m4p jPdA== 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=iCBeAnUK4EbV+bL3GoZNgVbdBYhCOBrahiFPxfCR2dI=; b=ZSdND/+dAIJyZfn+hSeexZoOwm5hZfFVYq4uMpI7EnEBbrQC2aR4WGVFg7qLhZhcnT H/q+J6ep3dDHjKRe3dpBM4V31A3bEAK7uj1h4whT1yILeahPTxv+XNiH9JyHN5NjmRnd afvuzQxP8WeYjLNhE9BwmAfC0piS1knmRulRBuR2WQl0lEUTeuonrLmxtGqw+MqiOVHI 986NJrPxv0m5U7r0Pj0q/ziRxr5qA5tn3aSMni1Hg9J/uozYa5Q36QNNH2nOWtZbXnon tXJrZ37z73VS6GT7k8yzcnKj1lEehPN+ewM1W6lQlay9ZiH1fqBuwI5+s8NCWd/0Hi5S /81w== X-Gm-Message-State: APt69E1eA4V8xW0uTfm1wTtNe3M9qtdCT/12SwbzBED0+05BYwUl3dBH 3yMiR0l+Ao+jI+TuiOK7Iz06GXEZ X-Google-Smtp-Source: ADUXVKJdyrR8WUPQZjkHuV2wUcjQhL/cc2b7UtQd2M2Q01KfbCqvGbBLNsbopfwvop8dmMeifwV+MA== X-Received: by 2002:a17:902:5a83:: with SMTP id r3-v6mr22940729pli.78.1530481470832; Sun, 01 Jul 2018 14:44:30 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Sat, 30 Jun 2018 14:30:20 +0530 Message-Id: <1530349239-22049-17-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1530349239-22049-1-git-send-email-skrtbhtngr@gmail.com> References: <1530349239-22049-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.31]); Sun, 01 Jul 2018 21:44:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 01 Jul 2018 21:44:31 +0000 (UTC) for IP:'209.85.160.51' DOMAIN:'mail-pl0-f51.google.com' HELO:'mail-pl0-f51.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.766 * (DATE_IN_PAST_24_48, 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) 209.85.160.51 mail-pl0-f51.google.com 209.85.160.51 mail-pl0-f51.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 16/35] util: authconfig: 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.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 01 Jul 2018 21:44:53 +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 new 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. When a variable of type virAuthConfigPtr is declared using VIR_AUTOPTR, the function virAuthConfigFree will be run automatically on it when it goes out of scope. Signed-off-by: Sukrit Bhatnagar Reviewed-by: Erik Skultety --- src/util/virauthconfig.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h index ac0ceeb..d8a3849 100644 --- a/src/util/virauthconfig.h +++ b/src/util/virauthconfig.h @@ -24,6 +24,7 @@ # define __VIR_AUTHCONFIG_H__ =20 # include "internal.h" +# include "viralloc.h" =20 typedef struct _virAuthConfig virAuthConfig; typedef virAuthConfig *virAuthConfigPtr; @@ -42,4 +43,6 @@ int virAuthConfigLookup(virAuthConfigPtr auth, const char *credname, const char **value); =20 +VIR_DEFINE_AUTOPTR_FUNC(virAuthConfig, virAuthConfigFree) + #endif /* __VIR_AUTHCONFIG_H__ */ --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list