From nobody Sun Feb 8 17:41:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1624021510; cv=none; d=zohomail.com; s=zohoarc; b=n4MQ1MOxlyMKPXdHNbCTaGe9KThs8v4Yx8AeSEfAIZpySzuFshCcPBuFKkwOeqW89ZUUf3tAP6+JF+kWafIMYxsyQgE1H2qzW5eYLQNzF9dZhK2m3+k8l75IRvRk1FJDMKrxAOVQizXJDLPqfuaRGCKFSynODKx9EHYZdbGXfVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624021510; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UCadSFL3GmK81hbnEBdDpX9XvEELxu2cMh/5rTbwgGY=; b=hVMO1aCSW4HOuaQeY879K+b2t/RggoBkmwEUB7VBChP1khND+SLSimBpjbRiVT0MiGMWHykp0Lz4MF9YwU7B3qz7KdrBC6GkU9YzAeSnKvwJs4tWbDPSh/tXH6BzSHSxIHaU7wluXsweKAN5Q3xkzbU3WCkqYwmlHv87XSS1lGs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1624021510537348.5779695164522; Fri, 18 Jun 2021 06:05:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-485-WBXQ5sQWO12y31cuIc7hsg-1; Fri, 18 Jun 2021 09:05:07 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD03BFCB1; Fri, 18 Jun 2021 13:05:01 +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 7ABCF60FC2; Fri, 18 Jun 2021 13:05:00 +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 75D611809C9A; Fri, 18 Jun 2021 13:04:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15ID4thi032726 for ; Fri, 18 Jun 2021 09:04:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 80DFE5C224; Fri, 18 Jun 2021 13:04:55 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5F215C233 for ; Fri, 18 Jun 2021 13:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624021509; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UCadSFL3GmK81hbnEBdDpX9XvEELxu2cMh/5rTbwgGY=; b=GaBTrcbshlImAgDEeRjcj5Lqz4lnsVcpxVztg4SDwROtORPXTkRl5nxE0CfnPA8AMJPwik EsNkDqcaQw2w4uV3VLH0U+IvyjsvjDZ+HInueK4f5pik520eh2Omxk3PwBnhkUMdJh2Lya kyh/CwCO6qP8zhsiZGAOgIWnothnAlU= X-MC-Unique: WBXQ5sQWO12y31cuIc7hsg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/4] conf: storage: Introduce virStoragePoolSourceListFree Date: Fri, 18 Jun 2021 15:04:46 +0200 Message-Id: <2bfba48992b343c096dfd542cff7c3d03ddb788d.1624021457.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- src/conf/storage_conf.c | 16 ++++++++++++++++ src/conf/storage_conf.h | 5 +++++ src/libvirt_private.syms | 1 + 3 files changed, 22 insertions(+) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 0ecdb0969a..2aa9a3d8f9 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1803,3 +1803,19 @@ virStoragePoolSourceListFormat(virStoragePoolSourceL= ist *def) return virBufferContentAndReset(&buf); } + + +void +virStoragePoolSourceListFree(virStoragePoolSourceList *list) +{ + size_t i; + + if (!list) + return; + + for (i =3D 0; i < list->nsources; i++) + virStoragePoolSourceClear(&list->sources[i]); + + g_free(list->sources); + g_free(list); +} diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 345026aa37..76efaac531 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -266,6 +266,11 @@ struct _virStoragePoolSourceList { virStoragePoolSource *sources; }; +void +virStoragePoolSourceListFree(virStoragePoolSourceList *list); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStoragePoolSourceList, virStoragePoolSour= ceListFree); + + virStoragePoolDef * virStoragePoolDefParseXML(xmlXPathContextPtr ctxt); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 2efa787664..68e4b6aab8 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1048,6 +1048,7 @@ virStoragePoolSourceClear; virStoragePoolSourceDeviceClear; virStoragePoolSourceFree; virStoragePoolSourceListFormat; +virStoragePoolSourceListFree; virStoragePoolSourceListNewSource; virStoragePoolTypeFromString; virStoragePoolTypeToString; --=20 2.31.1