From nobody Mon Feb 9 00:06:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1639052563; cv=none; d=zohomail.com; s=zohoarc; b=K4f4Y0pfZHLmLHqnlc26K3+SYCIrxLyYT1WrqGSpwJnqV3JokfjwAalXaJ5ieXipP4BaKqFA+FN0J/TBF9kPWkBA9qfEKDaAg5ng80Ns4g8VNv7jbSlliH/DBPREljX17RXYHoDgYrJ0TG3Ieus5mGK2Zm+4bXj9lxt0dWjFLHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639052563; 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=ZoB6++szfe3dxH5z1VNlnQZbiL432lPGghx8vafOxY0=; b=RNbOh7GqIdWvc7uLmiCNsqfcjhujnMqviCceEDY1vrGfoVxw0k37cscw1ehJOakLzQfopUqb2u4yZu2jG5PbhpKSdSipBecu5wO0zrGwK3QfrPTE4eoUAgxiJVvzN+fgLoVSDbSWXQSkGzXyMCn1JlwODVyFdYVyBfbGDn0TJr4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1639052563157241.2457986998802; Thu, 9 Dec 2021 04:22:43 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-308-68ppDSB3N06mjr3DMyz_pg-1; Thu, 09 Dec 2021 07:22:38 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CED5802E65; Thu, 9 Dec 2021 12:22:34 +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 671765BE0A; Thu, 9 Dec 2021 12:22:33 +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 315981802E2A; Thu, 9 Dec 2021 12:22:33 +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 1B9CMTF7015706 for ; Thu, 9 Dec 2021 07:22:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id B51785E24E; Thu, 9 Dec 2021 12:22:29 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E60E5ED27 for ; Thu, 9 Dec 2021 12:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639052562; 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=ZoB6++szfe3dxH5z1VNlnQZbiL432lPGghx8vafOxY0=; b=Yv/MIt/ZFyBKL6T5jFZa0jOvdTR81PHZAUAVOlyIowTnlrDFfcPIf9rSIfUt8Y3Qj8QX8V oHRUeSczTWhuA2dVsVlCGDBFQLLc7A3H/mF9aQIELNwJctjIgZo6PZJ1I0k+FBc0f70xUc GrWcQcKwK7dcbrnfkQkotVXLlpFf2TI= X-MC-Unique: 68ppDSB3N06mjr3DMyz_pg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 30/36] libxl_driver: Use automatic memory freeing for virBitmap Date: Thu, 9 Dec 2021 13:18:35 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.15 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) X-ZM-MESSAGEID: 1639052564504100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/libxl/libxl_driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 0b14b5093e..ef31f2cdcf 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -2416,7 +2416,7 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned in= t vcpu, libxlDriverPrivate *driver =3D dom->conn->privateData; libxlDriverConfig *cfg =3D libxlDriverConfigGet(driver); virDomainDef *targetDef =3D NULL; - virBitmap *pcpumap =3D NULL; + g_autoptr(virBitmap) pcpumap =3D NULL; virDomainVcpuDef *vcpuinfo; virDomainObj *vm; int ret =3D -1; @@ -2477,7 +2477,6 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned in= t vcpu, cleanup: virDomainObjEndAPI(&vm); - virBitmapFree(pcpumap); virObjectUnref(cfg); return ret; } @@ -4808,7 +4807,7 @@ libxlDomainGetNumaParameters(virDomainPtr dom, libxlDriverConfig *cfg =3D libxlDriverConfigGet(driver); virDomainObj *vm; libxl_bitmap nodemap; - virBitmap *nodes =3D NULL; + g_autoptr(virBitmap) nodes =3D NULL; int rc, ret =3D -1; size_t i, j; @@ -4907,7 +4906,6 @@ libxlDomainGetNumaParameters(virDomainPtr dom, ret =3D 0; cleanup: - virBitmapFree(nodes); libxl_bitmap_dispose(&nodemap); virDomainObjEndAPI(&vm); virObjectUnref(cfg); --=20 2.31.1