From nobody Tue May 13 22:25:36 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 1528400158688968.5741930133532; Thu, 7 Jun 2018 12:35:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C5CF308124A; Thu, 7 Jun 2018 19:35:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 605DA2B4AB; Thu, 7 Jun 2018 19:35:57 +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 ED914180121C; Thu, 7 Jun 2018 19:35:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w57JZrGs019136 for ; Thu, 7 Jun 2018 15:35:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 80E1B308BDB2; Thu, 7 Jun 2018 19:35:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78FDE308BDB1 for ; Thu, 7 Jun 2018 19:35:49 +0000 (UTC) Received: from mail-pg0-f46.google.com (mail-pg0-f46.google.com [74.125.83.46]) (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 6D218820E4 for ; Thu, 7 Jun 2018 19:35:37 +0000 (UTC) Received: by mail-pg0-f46.google.com with SMTP id p9-v6so5220606pgc.9 for ; Thu, 07 Jun 2018 12:35:37 -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.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 12:35:36 -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=ca1rysv5j4+fAbHwK4ZhXQvn/gYhwesrsUlJDt9s+yc=; b=UNbemecAkh15Bl+LXeLhODkcH/8aFlRIDHeNJ60LsFUqQzeB4IzkzTRjTvMFSpHDsB 9V0Ek3FfcN9ExW6xqteq4K7AdfkC3lrJBTdLW+YtgDwdWJYCr2HWkle1wI/U0jWEOLz5 M3X5DfMjzUxLeJP2CAxxyK5WY9HTzumPYBWBq/EnMnmywppwfr56J4NpS8FPpc4auzPI SGB6tIOcbGi+rHxljKLKKriwmWCMFu9x2rwvtarM8On9wx4kBWAylg+eeB+r0YtlqJyY ohEJWGLsIzm54d2ojj1voZpSncxHzWcm0Rb5nQ1qgw4zXscUIlPjYD+2W1pTf8oA6K4G mU3g== 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=ca1rysv5j4+fAbHwK4ZhXQvn/gYhwesrsUlJDt9s+yc=; b=fD83+Gexku4dUhGXYnWSb2mVMCEnLt8Mpc2mOHCzoKBNj4AW/ehG3or951JV0qgZS8 ticly1n0KIiGverq18yq0Xfxyln9EK8XdjxNVfb+Ff7xhqFU8kaY1KdY1DFRArZ73LS1 2o13XesahJXOgZKc/yEh6/hBO2j19DwHDbU8mShYHgurEAJdDwskCdz2hAw652QHjtvY dWf4k6CwAYxF7TTNtvFhT749VBqvDjbaJ2q4s+XwHD1qzx7+BWLbKQJuYFmAYuFLIZbR fNwyW6gLqlyTy8RM+8U3WJKeWnF+t9qqopxvTXSOYpoCimcfF3pV18+lwHPxOfPDehrP 5VjQ== X-Gm-Message-State: APt69E2aOBCIrS53FEo9nhYcNnrjwnSLM3uUtzsAlHi7xgBhEdP9C8hj OmQDbgDp9c7cCFD1We3GH8OB1sq9 X-Google-Smtp-Source: ADUXVKL9HLlqpNvELjZTo0ncDIfejOnnwsCSrQPqW8AYgSwEowPFbo1PeVZTTz0jqcL4koxznAuDHA== X-Received: by 2002:a62:3fdd:: with SMTP id z90-v6mr2954974pfj.216.1528400136668; Thu, 07 Jun 2018 12:35:36 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Fri, 8 Jun 2018 01:04:41 +0530 Message-Id: <1528400083-6788-20-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.26]); Thu, 07 Jun 2018 19:35:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 07 Jun 2018 19:35:37 +0000 (UTC) for IP:'74.125.83.46' DOMAIN:'mail-pg0-f46.google.com' HELO:'mail-pg0-f46.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.301 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, SPF_PASS, T_DKIM_INVALID) 74.125.83.46 mail-pg0-f46.google.com 74.125.83.46 mail-pg0-f46.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 19/21] 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 07 Jun 2018 19:35:58 +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/virbitmap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index 2464814..86bb84e 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 @@ -44,6 +45,8 @@ virBitmapPtr virBitmapNewEmpty(void) ATTRIBUTE_RETURN_CHE= CK; */ void virBitmapFree(virBitmapPtr bitmap); =20 +VIR_DEFINE_AUTOPTR_FUNC(virBitmapPtr, virBitmapFree) + /* * Copy all bits from @src to @dst. The bitmap sizes * must be the same --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list