From nobody Tue May 13 18:33:05 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 153048152946042.609438822615516; Sun, 1 Jul 2018 14:45:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E23830820D2; Sun, 1 Jul 2018 21:45: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 2089A5C545; Sun, 1 Jul 2018 21:45: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 C24A924F12; Sun, 1 Jul 2018 21:45:27 +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 w61LjLQn009541 for ; Sun, 1 Jul 2018 17:45:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id A058A6090A; Sun, 1 Jul 2018 21:45:21 +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 94C3E608F8 for ; Sun, 1 Jul 2018 21:45:17 +0000 (UTC) Received: from mail-pg0-f49.google.com (mail-pg0-f49.google.com [74.125.83.49]) (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 90C3FC047B63 for ; Sun, 1 Jul 2018 21:45:06 +0000 (UTC) Received: by mail-pg0-f49.google.com with SMTP id e11-v6so6212699pgq.0 for ; Sun, 01 Jul 2018 14:45:06 -0700 (PDT) Received: from centos.localdomain ([157.37.164.55]) by smtp.gmail.com with ESMTPSA id v68-v6sm15006933pfv.143.2018.07.01.14.45.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 14:45:05 -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=JrB5eyBCUFZaXVsMEQimhXJfs9e8CSX4i+J75Me5MAQ=; b=B0oq76N9UaZvzuD9WfTWAyBJcAOqtP3oW58H3qQ3SmzsnOMW+x99lgviwPdxgL9vld ucI2ziiTiympWwUTSqv9+s9MN+Z/CjGITZDYR7YaxKc/GG1VMqZt2B3ML8Cl2XY5SX7U p3BNBLqMERTopcwU1XW7QPXha48YkpnGPweN8+qICJQSYGJkspbxFNzlEY5dMUs/8JT8 t1UeDqVsJTLI/zQAg5GV6DAtlMur3xaJ1sAxCFotQqSb941QN8N8dvMDpj2dMikCzoPM M0YzsFSz84jgEDQ3eZbhbyCke10HDOBEuKtRuJ5i5Bmt9iLkpxjBmmPhZEaNrQQ+dwCI 6HUw== 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=JrB5eyBCUFZaXVsMEQimhXJfs9e8CSX4i+J75Me5MAQ=; b=AuvOFzUGm453rfP8S7QILPCLmp8Lbci6+wWSyAPPNVzVPQxiy3JIW8hvzK877VcJyu hD0CNdYqQ+LVcSLXpPrmBMwc958ZgSTPHPFD/O72CqFn8+3wtZXdCfr+SkJMIyB7Ao2I bT/Mbb1lfzqH9jPeEKbtrcJVFHuY+GBQuIAGztsAwrUhjd1HqtwO8YQPL+PsaILRYN6/ LoKvV6HIjQrtxPTY0ZGlq74r9D4z1+8Ze4m9I9bJ47oaFG98SnZZ520ibKXIAng/DRnG M8nUCFHrKB4Ow5Miobn7dFJM/uq4h3ZJvxQHhWFlg6KeW78PUfXUgzKzXTlrLMGqRvQh zIuA== X-Gm-Message-State: APt69E1UDtv1GNxSDrkabzd2KOwutEXJMFEmY9auU1Okk93wz17/gUza Db9k9EGZsBujv2THk+Ju0WxnNoS7 X-Google-Smtp-Source: AAOMgpf0Uqk+YEb1PaY7QJt4OhAlt/9TGtd7LOWp67w4/fkl4m+iCugTCroirZQEPiFMinLTqu/Cqg== X-Received: by 2002:a62:3783:: with SMTP id e125-v6mr22744780pfa.232.1530481505826; Sun, 01 Jul 2018 14:45:05 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Sat, 30 Jun 2018 14:30:30 +0530 Message-Id: <1530349239-22049-27-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:45:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 01 Jul 2018 21:45:06 +0000 (UTC) for IP:'74.125.83.49' DOMAIN:'mail-pg0-f49.google.com' HELO:'mail-pg0-f49.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.786 * (DATE_IN_PAST_24_48, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, SPF_PASS, T_DKIM_INVALID) 74.125.83.49 mail-pg0-f49.google.com 74.125.83.49 mail-pg0-f49.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 26/35] 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sun, 01 Jul 2018 21:45:29 +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