From nobody Sun Feb 8 17:22:37 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=1614768539; cv=none; d=zohomail.com; s=zohoarc; b=T2c6nndYeQgXboOVxCURXrVZ+1dVKfXIxqvXIYnfqy3e4IDZFU4+jXjhAvidqNjse4DGmY7tXxImHzD2xC8izcET2xhlfncTzFJD3+nmyuvSbq78JyNVeh91ceS74Q4bcNJ5gzakc6JR3A+OGY8L+4kWo+J0k8wD9OcQhO7XI1c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614768539; 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=XCIGljerh8iJfWRBMArNwdR/+ERZUcn1/vFEIBJ+0rc=; b=c81THoZTb3MhN4nPlQVlzTyrw1QlK7oCXVqVvRqKrKL/kJX/w1ndG0vJ+lrv808zzuILv2XMk5X/2qeVDbCkSixUzoDGd7W7IG9HMAqqXQUQkECSebqaEMWW/PZOwrKYh0fMyL9i0vmdMrBTz+8uJq2+4dTgZHZtVanS6T7N6z8= 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) header.from= 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 1614768539834896.3168096878592; Wed, 3 Mar 2021 02:48:59 -0800 (PST) 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-603-7KCSLnEgPGmrFEnJ5fxn5g-1; Wed, 03 Mar 2021 05:48:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B191C107ACE3; Wed, 3 Mar 2021 10:48:50 +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 8889710016FF; Wed, 3 Mar 2021 10:48:50 +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 4F6FB1809C91; Wed, 3 Mar 2021 10:48:50 +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 123AmneV028438 for ; Wed, 3 Mar 2021 05:48:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3C87A5D9E8; Wed, 3 Mar 2021 10:48:49 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.195.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 916A95D9DD for ; Wed, 3 Mar 2021 10:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614768538; 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=XCIGljerh8iJfWRBMArNwdR/+ERZUcn1/vFEIBJ+0rc=; b=caIN+xh7xOr1MMq9/3P7Hm8kDHfjMq131abNA6Ed7/TMPU3XP6Ym6yayjfZmkeF6Ue/2yg GJdC+Z+oOsivwS/D/reRq762Tdgj8m/gVnNuqMiVx6rzGW/M4JqzkNEoz1lPr/vXcPX8wq jFD6uwhA7NdPruYOTt+Tfilyoz/jw9k= X-MC-Unique: 7KCSLnEgPGmrFEnJ5fxn5g-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH v2 5/6] Use g_autoptr instead of virNetDevBandwidthFree where possible Date: Wed, 3 Mar 2021 11:48:19 +0100 Message-Id: <8aed13434be3e899d38c81edb09154fbe27e2b07.1614767298.git.khanicov@redhat.com> 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.84 on 10.5.11.22 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: Kristina Hanicova --- src/network/bridge_driver.c | 3 +-- src/qemu/qemu_driver.c | 5 ++--- src/test/test_driver.c | 3 +-- tests/virnetdevbandwidthtest.c | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 29060139d7..b29c37ef4c 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -5397,7 +5397,7 @@ networkPortSetParameters(virNetworkPortPtr port, virNetworkObjPtr obj; virNetworkDefPtr def; virNetworkPortDefPtr portdef; - virNetDevBandwidthPtr bandwidth =3D NULL; + g_autoptr(virNetDevBandwidth) bandwidth =3D NULL; g_autofree char *dir =3D NULL; int ret =3D -1; size_t i; @@ -5473,7 +5473,6 @@ networkPortSetParameters(virNetworkPortPtr port, =20 ret =3D 0; cleanup: - virNetDevBandwidthFree(bandwidth); virNetworkObjEndAPI(&obj); return ret; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b18e46e383..2a191232a6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10207,7 +10207,8 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, virDomainDefPtr persistentDef; int ret =3D -1; virDomainNetDefPtr net =3D NULL, persistentNet =3D NULL; - virNetDevBandwidthPtr bandwidth =3D NULL, newBandwidth =3D NULL; + g_autoptr(virNetDevBandwidth) bandwidth =3D NULL; + g_autoptr(virNetDevBandwidth) newBandwidth =3D NULL; g_autoptr(virQEMUDriverConfig) cfg =3D NULL; bool inboundSpecified =3D false, outboundSpecified =3D false; int actualType; @@ -10421,8 +10422,6 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, qemuDomainObjEndJob(driver, vm); =20 cleanup: - virNetDevBandwidthFree(bandwidth); - virNetDevBandwidthFree(newBandwidth); virDomainObjEndAPI(&vm); return ret; } diff --git a/src/test/test_driver.c b/src/test/test_driver.c index bca1297d1d..0ac03de127 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3446,7 +3446,7 @@ testDomainSetInterfaceParameters(virDomainPtr dom, virDomainObjPtr vm =3D NULL; virDomainDefPtr def; virDomainNetDefPtr net =3D NULL; - virNetDevBandwidthPtr bandwidth =3D NULL; + g_autoptr(virNetDevBandwidth) bandwidth =3D NULL; bool inboundSpecified =3D false; bool outboundSpecified =3D false; size_t i; @@ -3536,7 +3536,6 @@ testDomainSetInterfaceParameters(virDomainPtr dom, =20 ret =3D 0; cleanup: - virNetDevBandwidthFree(bandwidth); virDomainObjEndAPI(&vm); return ret; } diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index 5cbdd6ffea..2e76af3d0c 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -69,7 +69,7 @@ testVirNetDevBandwidthSet(const void *data) int ret =3D -1; const struct testSetStruct *info =3D data; const char *iface =3D info->iface; - virNetDevBandwidthPtr band =3D NULL; + g_autoptr(virNetDevBandwidth) band =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; char *actual_cmd =3D NULL; =20 @@ -98,7 +98,6 @@ testVirNetDevBandwidthSet(const void *data) ret =3D 0; cleanup: virCommandSetDryRun(NULL, NULL, NULL); - virNetDevBandwidthFree(band); VIR_FREE(actual_cmd); return ret; } --=20 2.29.2