From nobody Mon Feb 9 09:28:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1614768538; cv=none; d=zohomail.com; s=zohoarc; b=V9w9BzP6WaKKRBrHGd3HkkVh9zusKzh/djjXIDg0amyzjbWw2eAbORV0HRXH/3c8M6AvzYb4jRMGQproBnnkfIMrOfU2xSg9Y1UYEJfDgHyrmx4gVXhYbDbqtmbkgq6YC4W+DV5YnoKMSL1UBcO8gAw/GyNJl8nrAzqw+VoUvq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614768538; 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=paTcTuwX5FqzE2Ssnj01jEV4IfaY+Ezll2DtUtsUvMg=; b=MDQ+jYEjLKGMBom+pXY1x1Lv0hcl1L8RgYi6Qin8Mb1cOyQO9rqHjDHXL2aHqjkhJhACWXURNKk+JiM6sV9dIBkRT9+xwFhiH1WrrXvZdIfoGVoMIO07vtNcisRmaGU4nAkpKXYKtgAeuthogBifHUw/dm0P+/T8zUsIaSBE0ro= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614768538041249.87028001969384; Wed, 3 Mar 2021 02:48:58 -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-298-38cBY7zmMs2V_eJy6K60uw-1; Wed, 03 Mar 2021 05:48:52 -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 0B8AB185A0CE; Wed, 3 Mar 2021 10:48:47 +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 D64BD10013C1; Wed, 3 Mar 2021 10:48:46 +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 9DAC358076; Wed, 3 Mar 2021 10:48:46 +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 123AmiIG028426 for ; Wed, 3 Mar 2021 05:48:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 52B0A5D9DD; Wed, 3 Mar 2021 10:48:44 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.195.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 938215D9D7 for ; Wed, 3 Mar 2021 10:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614768533; 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=paTcTuwX5FqzE2Ssnj01jEV4IfaY+Ezll2DtUtsUvMg=; b=EbRHv9sloPWRquJOrQxaT/3dA41bcz5FM9jNxlJXpA/mz4+Bj6sCJSxJa4OC53OUDUVN5W uqNu3vWNz02onliqhbhddkEr+rlGVZUA9EL2Ixod/WJxzMeSw8mC67CMPz+cOS1CyPcSCn IlphLjM+ozSrI+JI/omgcdJAHYAaKo4= X-MC-Unique: 38cBY7zmMs2V_eJy6K60uw-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH v2 4/6] Use g_steal_pointer where possible Date: Wed, 3 Mar 2021 11:48:18 +0100 Message-Id: <52c037f5c338fec7c1a0241dfa1359f8143c28f8.1614767297.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 | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 519a473995..29060139d7 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -5466,8 +5466,7 @@ networkPortSetParameters(virNetworkPortPtr port, goto cleanup; =20 virNetDevBandwidthFree(portdef->bandwidth); - portdef->bandwidth =3D bandwidth; - bandwidth =3D NULL; + portdef->bandwidth =3D g_steal_pointer(&bandwidth); =20 if (virNetworkPortDefSaveStatus(portdef, dir) < 0) goto cleanup; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b9bbdf8d48..b18e46e383 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10375,8 +10375,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, =20 virNetDevBandwidthFree(net->bandwidth); if (newBandwidth->in || newBandwidth->out) { - net->bandwidth =3D newBandwidth; - newBandwidth =3D NULL; + net->bandwidth =3D g_steal_pointer(&newBandwidth); } else { net->bandwidth =3D NULL; } @@ -10394,8 +10393,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, =20 if (persistentNet) { if (!persistentNet->bandwidth) { - persistentNet->bandwidth =3D bandwidth; - bandwidth =3D NULL; + persistentNet->bandwidth =3D g_steal_pointer(&bandwidth); } else { if (bandwidth->in) { VIR_FREE(persistentNet->bandwidth->in); --=20 2.29.2