From nobody Tue Jul 1 05:40:21 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 1531504584542410.6459162575459; Fri, 13 Jul 2018 10:56:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC55630832EE; Fri, 13 Jul 2018 17:56:21 +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 B6305C6A3A; Fri, 13 Jul 2018 17:56:21 +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 529833F7CC; Fri, 13 Jul 2018 17:56:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6DHuJ6F008898 for ; Fri, 13 Jul 2018 13:56:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 457B05DA2A; Fri, 13 Jul 2018 17:56:19 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3CC965D968 for ; Fri, 13 Jul 2018 17:56:16 +0000 (UTC) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) (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 A5E3D32B675 for ; Fri, 13 Jul 2018 17:56:05 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id i26-v6so11625781pfo.12 for ; Fri, 13 Jul 2018 10:56:05 -0700 (PDT) Received: from centos.localdomain ([42.106.1.21]) by smtp.gmail.com with ESMTPSA id n5-v6sm26866817pgr.24.2018.07.13.10.56.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 10:56:04 -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=M36UNoRu6Q0TXlQLCg6APbBIy3D1NI7MRZNJpioEbtw=; b=H0EwYwrGRR02X0fwF0iwwAd9oJBp4IJPhdQGkQ2icstBIYihVMcj3cKPbhJ1cUFzaI E6Dbwt7H4CCS+LSn71Q7s5ljumrpJpWTOV81KsSp/gAqKrXJD5HCsSAOayUOquncv7MP I8zHsdRVr8iZQB+7C0CDzRRKUUVoG7vCsb+Z3wFQXnu+8NfOMfD3aoHzr2TvneIfcMfr xnP7HD6VK+OA3/9NHJOwKceFFK/rVxFzbQC4QO+QB/9b5bT5RsKCQ0pHCvGxsSUphax7 ixvj2irE2bWYHaTqp00QzbP4hm/etxVT4fky9CdANvASvMPBxqVTCzQcRwUzizsqFKsM Rzvg== 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=M36UNoRu6Q0TXlQLCg6APbBIy3D1NI7MRZNJpioEbtw=; b=KTFI9LoIwuQyIm/77tONopegNY6a/kFMjAkGA1F4RdvmqRpLRyyiPf8EnLjitNUCPL ZEQ8rA9LWHOtAv1z1XSQH+HPlTeOoQ5JsA5DSk51SgBWNcaV6WK8tCiiYx/XvxxNJkum zsyVchUmOOQOt8X39lUPHcV2IY3clZLLFfYHwLtNVzniZUhMSzSfo3R7ZVc69g7wNseF PB8vWyeaLoiT5yY5e/PBNeBaFWR/yFkXgz0r1lOlK71ev40TDdbXqyLxhmr2R5Uqr+yo m5YuY3bb0fT5hfiDecFuT3lzDiLCDt2Mlvq10X0hc0tP1aXVqXD6eIBbD9Qbbnc9N+EM 53MQ== X-Gm-Message-State: AOUpUlHvkRTIadTdJFD96Zu9pL8we+PuvongfdLNio4hAfNbR7dC5i5Q 6W9dASL0Gpo+pavBdHU4CgbpUA6z X-Google-Smtp-Source: AAOMgpdhObfEvHpbKYvBsLFiwxnU/SNbqaARwdSt8KUs3wZz0DcoHlgtEjIJTmMy3vDlvOhmtBSpiw== X-Received: by 2002:a62:4808:: with SMTP id v8-v6mr8137956pfa.89.1531504564947; Fri, 13 Jul 2018 10:56:04 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Fri, 13 Jul 2018 23:25:00 +0530 Message-Id: <1531504509-7930-23-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1531504509-7930-1-git-send-email-skrtbhtngr@gmail.com> References: <1531504509-7930-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.38]); Fri, 13 Jul 2018 17:56:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 13 Jul 2018 17:56:05 +0000 (UTC) for IP:'209.85.192.195' DOMAIN:'mail-pf0-f195.google.com' HELO:'mail-pf0-f195.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.3 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.192.195 mail-pf0-f195.google.com 209.85.192.195 mail-pf0-f195.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 22/31] util: bitmap: 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.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 13 Jul 2018 17:56:23 +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 virBitmapPtr is declared using VIR_AUTOPTR, the function virBitmapFree will be run automatically on it when it goes out of scope. Signed-off-by: Sukrit Bhatnagar Reviewed-by: Erik Skultety --- src/util/virbitmap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index 2464814..312e7e2 100644 --- a/src/util/virbitmap.h +++ b/src/util/virbitmap.h @@ -25,6 +25,7 @@ # define __BITMAP_H__ =20 # include "internal.h" +# include "viralloc.h" =20 # include =20 @@ -155,4 +156,6 @@ void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b) =20 void virBitmapShrink(virBitmapPtr map, size_t b); =20 +VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree) + #endif --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list