From nobody Sun Feb 8 18:30:04 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; 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 1532175031659955.2309511818175; Sat, 21 Jul 2018 05:10:31 -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 512DE8110B; Sat, 21 Jul 2018 12:10:24 +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 20977300165E; Sat, 21 Jul 2018 12:10:24 +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 C69154EE10; Sat, 21 Jul 2018 12:10:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6LC8ZTP016484 for ; Sat, 21 Jul 2018 08:08:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id AAF5C608F7; Sat, 21 Jul 2018 12:08:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F723608F2 for ; Sat, 21 Jul 2018 12:08:30 +0000 (UTC) Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) (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 730823082A2E for ; Sat, 21 Jul 2018 12:08:19 +0000 (UTC) Received: by mail-pl0-f66.google.com with SMTP id m1-v6so1307839plt.6 for ; Sat, 21 Jul 2018 05:08:19 -0700 (PDT) Received: from centos.localdomain ([42.106.1.69]) by smtp.gmail.com with ESMTPSA id s16-v6sm5861694pfm.114.2018.07.21.05.08.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jul 2018 05:08:18 -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=agybgkDLoFNm7SHAOmTtW5J+cnNnqnu/j7pnze7enoY=; b=dELWk4iWzKxQaTjOroNcyyLhDa31Py1+an1i3m7wTsDNTKqVT8Azu9vsbYLF/BuUJx 0X0/e4zlOdC22kGqtWAyNHDvpiFLs19TsWRlMlrLxOmAL5n+xv7GXr4075HuKmUxy0TN XIc5UYtLIc74AxTVS6nL84t8IbOLPquIIRQjpFPl5nqVOHvzLBDTwB6AkPhcqHXjKpHw wu/cMTU/z63L8+sNeYh2fChmMdFWWNNW7vZ3sLXhOBPzS9XvzOluhBnJY9gAV8hLSO5o JBfKtrv5nHTrXZG6lQPNcl6g9QNkrTds6AAYBO+/zGqQENGPooMxrgg+2y5SM7kREPV3 HWoQ== 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=agybgkDLoFNm7SHAOmTtW5J+cnNnqnu/j7pnze7enoY=; b=mi4pgolYK4w2aPeyCblPwfR1LQ0BkqztUoorTN5akTvSvEH9tVJRVEpVF0lbDcgVC7 ttqL6MLEDTXNu5cpkbDYfCy/g4dwxp5cKkixz3tJxSFz2K4yYim3Mnk3AlXTivV1icNM mVfmtszQULI4S6U7HXnXi1qe3gLUMYpVvS/bBb9E+5gNdiFd8hA5NGMCo5Z4ZMVDhUFY BVyM+bIM5qTMJrNFJ2eKluOGQUeF+4LmASTPpqqMziqO1nTIg5WMWLGo/4NW9DWaEjy/ /FY5h4KLe73CyfJamsUXIodHtnVvFcZ44llL7EWhxXMiBBySPdSOohEk/6aPy4ify/eF TlTw== X-Gm-Message-State: AOUpUlH4jftswLurxwmjlfccFlivFrdtDMzIfFW1nMYj5MQVpLf5NECu CIEWRkf9ik+ekZRisdx1lPU/LAlK X-Google-Smtp-Source: AAOMgpfvNk3IxX0zcTUUi7ZEq4SqWPk99p5w8YR+YJK3iJHuIkeb8kodZ0gbIZM2lY9q8usM+qtjKw== X-Received: by 2002:a17:902:599b:: with SMTP id p27-v6mr5575040pli.191.1532174898692; Sat, 21 Jul 2018 05:08:18 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Sat, 21 Jul 2018 17:36:54 +0530 Message-Id: <1532174832-21644-23-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1532174832-21644-1-git-send-email-skrtbhtngr@gmail.com> References: <1532174832-21644-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.45]); Sat, 21 Jul 2018 12:08:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Sat, 21 Jul 2018 12:08:19 +0000 (UTC) for IP:'209.85.160.66' DOMAIN:'mail-pl0-f66.google.com' HELO:'mail-pl0-f66.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) 209.85.160.66 mail-pl0-f66.google.com 209.85.160.66 mail-pl0-f66.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 22/40] util: netdevvlan: 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.28]); Sat, 21 Jul 2018 12:10:30 +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. Also, drop the redundant viralloc.h include, since that has moved from the source module into the header. When a variable of type virNetDevVlanPtr is declared using VIR_AUTOPTR, the function virNetDevVlanFree will be run automatically on it when it goes out of scope. Signed-off-by: Sukrit Bhatnagar Reviewed-by: Erik Skultety --- src/util/virnetdevvlan.c | 1 - src/util/virnetdevvlan.h | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virnetdevvlan.c b/src/util/virnetdevvlan.c index 4c8bce5..0afc47b 100644 --- a/src/util/virnetdevvlan.c +++ b/src/util/virnetdevvlan.c @@ -24,7 +24,6 @@ #include "internal.h" #include "virerror.h" #include "virnetdevvlan.h" -#include "viralloc.h" =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h index 7f63626..be85f59 100644 --- a/src/util/virnetdevvlan.h +++ b/src/util/virnetdevvlan.h @@ -23,6 +23,8 @@ =20 # include =20 +# include "viralloc.h" + typedef enum { VIR_NATIVE_VLAN_MODE_DEFAULT =3D 0, VIR_NATIVE_VLAN_MODE_TAGGED, @@ -48,4 +50,6 @@ void virNetDevVlanFree(virNetDevVlanPtr vlan); int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b); int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src); =20 +VIR_DEFINE_AUTOPTR_FUNC(virNetDevVlan, virNetDevVlanFree) + #endif /* __VIR_NETDEV_VLAN_H__ */ --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list