From nobody Tue Apr 30 22:14:34 2024 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=1629896120; cv=none; d=zohomail.com; s=zohoarc; b=hrE1dij1amcqOPvVZ5pX7xTaryLswSdKRLeNHBZt48G/N+5FRV734vkmRE5qKjVP1VieMt9O9I5JJXQdAhVwD9DQ5WHwyR6g3/3MZdtcRyQ5h33IS3eXBY2R+5U2ga2ShDLw06RGDtoxmE/ijoar/jgit78CPZrz+g99nYZWbnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629896120; 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=2qHkr/DhCqj/McGvbuXriZ01as83gZFw5jDV9qWYOcY=; b=fhPYkoBoxwiocrS81oB56m3Wwnonh8xiS6jUcc38n5mphkyhS4S230pk7tk4uZAr3yl/UigsGTpz5h79RZU1rsClF8NHon5D2ZG6S/mXsz6kF3XLBKRrZIVpBEEqQXb4431uHFB8MnfJyLX4IQ72SaoltHIXUNtAP7dgRKVz2Ow= 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 1629896120550162.95011511642383; Wed, 25 Aug 2021 05:55:20 -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-96-Q8t5DQDdOvKdidG-dOyVcQ-1; Wed, 25 Aug 2021 08:55:17 -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 351D71008065; Wed, 25 Aug 2021 12:55:12 +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 15DE360C04; Wed, 25 Aug 2021 12:55:12 +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 CBA704BB7C; Wed, 25 Aug 2021 12:55:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PCtBR0015122 for ; Wed, 25 Aug 2021 08:55:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2608D10016FB; Wed, 25 Aug 2021 12:55:11 +0000 (UTC) Received: from bart.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4AAA10074F8 for ; Wed, 25 Aug 2021 12:55:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629896119; 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=2qHkr/DhCqj/McGvbuXriZ01as83gZFw5jDV9qWYOcY=; b=coc0Pf12o5d+Pdxui6eh0ts9E4tXvFY/7EnNgU3AAGEXir7dnb5J+aNYR4yMHx7e88pxSo B43nzfwf3kY+L3ImT6QnN+K/RyXKm0XG6iLf1GiJgRi/45Gi2LD68P+L01+bcUA8Okgqv4 jnDvV9wXDkOh2t06CxZ1NT+XbXGSeqs= X-MC-Unique: Q8t5DQDdOvKdidG-dOyVcQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] virpci: Avoid Clang false positive Date: Wed, 25 Aug 2021 14:54:56 +0200 Message-Id: <5a47517cbdd6968f428b4f754a371a2af0565b25.1629895768.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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) X-ZM-MESSAGEID: 1629896122437100003 Content-Type: text/plain; charset="utf-8" The virPCIDeviceIsBehindSwitchLackingACS() function checks whether given PCI device is not behind a switch that lacks ACS. It does so by starting at given device and traversing up, one parent at time towards the root. The parent device is obtained via virPCIDeviceGetParent() which allocates new virPCIDevice structure. For freeing the structure we use g_autoptr() and a temporary variable @tmp. However, Clang fails to understand our clever algorithm and complains that the variable is set but never used. This is obviously a false positive, but using a small trick we can shut Clang up. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/virpci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virpci.c b/src/util/virpci.c index 915a4903ca..f307580a53 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2150,8 +2150,8 @@ virPCIDeviceIsBehindSwitchLackingACS(virPCIDevice *de= v) return 1; } =20 - tmp =3D parent; - ret =3D virPCIDeviceGetParent(parent, &parent); + tmp =3D g_steal_pointer(&parent); + ret =3D virPCIDeviceGetParent(tmp, &parent); if (ret < 0) return -1; } while (parent); --=20 2.31.1 From nobody Tue Apr 30 22:14:34 2024 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=1629896122; cv=none; d=zohomail.com; s=zohoarc; b=Q6wZGRMFpneYJSUW/bXnfsILch1cV4tO0+85yj1emCHXKU5hzQMQ4CwqyXfnM0T2MxuFKHk8e/kLjOZw1h2UoN7int0VCnCUCAVuKTkU9Sd19V4dXyUBPKqyI2YOwnxs5R4qFabfKNYMjFWkJu1qrOs4oGd1GlbWVbeCzeEDjeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629896122; 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=tzZe8cLLFazckOlGdg0I1AO0+6ukj/gPAu+Pr2idPZ8=; b=aI4MXsVN1MmAaagb7jvk2/QmQUmZ9MgVJ6hj2zHF5SgzVjW3lEAINZ+PCrSYMBibnJ4vYjJlc4P+/QQm08TViNnS7m+qUgWIawzAX/ZTckTfEvuDJz4wkstkkQIVif95UV1FRc2XfBt++OD1NzEx5g9bBdft4YxdnjPQM25gWPk= 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 1629896122914862.0259053465846; Wed, 25 Aug 2021 05:55:22 -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-499-DOgvagvyPuOSS14XR29IRA-1; Wed, 25 Aug 2021 08:55:20 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5A85D108292C; Wed, 25 Aug 2021 12:55:15 +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 119455FC25; Wed, 25 Aug 2021 12:55:15 +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 B48F3182188A; Wed, 25 Aug 2021 12:55:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PCtBgS015132 for ; Wed, 25 Aug 2021 08:55:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id EA0E210023B0; Wed, 25 Aug 2021 12:55:11 +0000 (UTC) Received: from bart.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74C0E10016FB for ; Wed, 25 Aug 2021 12:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629896121; 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=tzZe8cLLFazckOlGdg0I1AO0+6ukj/gPAu+Pr2idPZ8=; b=AfSu3pwaZ7ZANy+hnwUILONKzdBYYtwN9Kql5/el8rGrNssZbxqhLEcXqPTiw/HIoC5FPr lQ5diZJ2CnwmQ8MA0CV3k3ydJMtTTNXCEzIHBECeLhmSE+g9ax4n3xGeWQ2hDHIXOux+CY j4Cv9ITTfPmP7SKDutogS6kae8gSLS4= X-MC-Unique: DOgvagvyPuOSS14XR29IRA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/4] test: Drop unused @cfg from qemu*test Date: Wed, 25 Aug 2021 14:54:57 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.16 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: 1629896124701100001 Content-Type: text/plain; charset="utf-8" In qemumigrationcookiexmltest and qemustatusxml2xmltest there is @cfg variable that is unused. It's set via virQEMUDriverGetConfig() but then never used. Drop it. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- tests/qemumigrationcookiexmltest.c | 2 -- tests/qemustatusxml2xmltest.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/tests/qemumigrationcookiexmltest.c b/tests/qemumigrationcookie= xmltest.c index ba7088c567..6ef5dc0ad6 100644 --- a/tests/qemumigrationcookiexmltest.c +++ b/tests/qemumigrationcookiexmltest.c @@ -401,7 +401,6 @@ static int mymain(void) { int ret =3D 0; - g_autoptr(virQEMUDriverConfig) cfg =3D NULL; g_autoptr(GHashTable) capslatest =3D NULL; g_autoptr(virConnect) conn =3D NULL; =20 @@ -412,7 +411,6 @@ mymain(void) if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; =20 - cfg =3D virQEMUDriverGetConfig(&driver); driver.privileged =3D true; =20 if (!(conn =3D virGetConnect())) diff --git a/tests/qemustatusxml2xmltest.c b/tests/qemustatusxml2xmltest.c index d58f4b69da..cd43820551 100644 --- a/tests/qemustatusxml2xmltest.c +++ b/tests/qemustatusxml2xmltest.c @@ -77,7 +77,6 @@ mymain(void) { int ret =3D 0; g_autofree char *fakerootdir =3D NULL; - g_autoptr(virQEMUDriverConfig) cfg =3D NULL; g_autoptr(GHashTable) capslatest =3D testQemuGetLatestCaps(); g_autoptr(GHashTable) capscache =3D virHashNew(virObjectFreeHashData); g_autoptr(virConnect) conn =3D NULL; @@ -100,7 +99,6 @@ mymain(void) if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; =20 - cfg =3D virQEMUDriverGetConfig(&driver); driver.privileged =3D true; =20 if (!(conn =3D virGetConnect())) --=20 2.31.1 From nobody Tue Apr 30 22:14:34 2024 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=1629896128; cv=none; d=zohomail.com; s=zohoarc; b=DvWGzVZ6Yls/wwLVULfhPIurZn+ecvwAeTZV/ipAu+hD02Ancrqt/DzC+jtzWOqkXKitmZTuTR7Oh1nATMFoXXinItfX5wGm3akp/jJ+iZxpxqm+txc3l/mRP1yFiItCcSHk2UUxYqMwqrao1CXfloju+fCl3v6RNxJ3y4GmhQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629896128; 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=0qId6VEhbvvlEXC7QJ3FXxya8zYpO5RtKTr5kO0wROY=; b=XuFO4+keD1MI4qLHUmhskZ5lJaQR0zwQm7UBIl2wLHDtTzcHU87HUkoFXe63qMShyVCh1STtWdtmcd9P9R+ocRy511GVbAHynDq7hPrZTvazWHhUr2zMQzQpXE7LKzh6heuMlP4Y3cjS8ultji6/op1u9cEyj3mofUjG1WDYQpI= 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 1629896128602847.4909670235494; Wed, 25 Aug 2021 05:55:28 -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-575-u29QmW6cOzmKWKTGsXxVDg-1; Wed, 25 Aug 2021 08:55:25 -0400 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 D3AAEC7401; Wed, 25 Aug 2021 12:55:19 +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 B2E181036D3F; Wed, 25 Aug 2021 12:55:19 +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 7E19B4A707; Wed, 25 Aug 2021 12:55:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PCtCCT015137 for ; Wed, 25 Aug 2021 08:55:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id B874610074F8; Wed, 25 Aug 2021 12:55:12 +0000 (UTC) Received: from bart.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4354B10016FB for ; Wed, 25 Aug 2021 12:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629896127; 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=0qId6VEhbvvlEXC7QJ3FXxya8zYpO5RtKTr5kO0wROY=; b=Jk6FjiUv8j0FC+BQWmvOuyOKKMuQoqLFDntt1L2q9aDx7Ecjz3uby4rhyRW3zfxpfazhqI B+F4KNuQdaG+KRZjEuKt0lvyS/9D1bOeRovTX1wAnXigKzP3D1fuId1DWe8QzM4hJD1G+l LOfVesTxjHu/2INuZ3jmYKUX+jRRUp0= X-MC-Unique: u29QmW6cOzmKWKTGsXxVDg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] virscsi: Drop @tmp from virSCSIDeviceListDel Date: Wed, 25 Aug 2021 14:54:58 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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) X-ZM-MESSAGEID: 1629896129308100001 Content-Type: text/plain; charset="utf-8" Clang on Rawhide started to complain that @tmp variable in virSCSIDeviceListDel() is set but not used. This is obviously a false positive because the variable is used to free device stolen from the list. Anyway, we can do without the variable so in this specific case let's fix our code to appease Clang. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/virscsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virscsi.c b/src/util/virscsi.c index 2488b0e5f8..6a90d9002f 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -414,8 +414,7 @@ virSCSIDeviceListDel(virSCSIDeviceList *list, virSCSIDeviceUsedByInfoFree(dev->used_by[i]); VIR_DELETE_ELEMENT(dev->used_by, i, dev->n_used_by); } else { - g_autoptr(virSCSIDevice) tmp =3D NULL; - tmp =3D virSCSIDeviceListSteal(list, dev); + virSCSIDeviceFree(virSCSIDeviceListSteal(list, dev)); } break; } --=20 2.31.1 From nobody Tue Apr 30 22:14:34 2024 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=1629896131; cv=none; d=zohomail.com; s=zohoarc; b=fvV8fQiEsYwhnN3+YhjZatFk7+eFuh2BGm5ON0m3+vCmsukdTHY+v4RjLB8D1SjmmACVimO8iYmG0mOwM+O6vHAW8jnKkEkc8wIhsLtZQo4PQXszxawkBPDvJKcFuJdLQW6K9h8diqCiViMArcpndMtmbEaMn3rFGGbVkDx4fm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629896131; 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=UKx1EzJiXvOA1ZCbtmzP/S227uYNXbyy4Z4BC6JRirs=; b=ClsKaSriwiGV1NBwU+H/DuWTZe0RO6kbEQf2fn8fIpLNDI8F0RYz8vjk86dBVZlGZtIQLbpg+E4QK5Ic/orB2IWTacaGab0RH53rIHn5Fb+jODDlIHQe2sequAhpiMVRXgx5+yEI0z5Fwo9PQkT96THghY0Ner7COntru14fTVQ= 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 1629896131044519.7530825929894; Wed, 25 Aug 2021 05:55:31 -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-418-pD69N31QOKqUMZ9YYt5tSw-1; Wed, 25 Aug 2021 08:55:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D219B8799EF; Wed, 25 Aug 2021 12:55:19 +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 AFF9A68D95; Wed, 25 Aug 2021 12:55:19 +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 7EF194A708; Wed, 25 Aug 2021 12:55:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PCtDTP015152 for ; Wed, 25 Aug 2021 08:55:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 875E510016FB; Wed, 25 Aug 2021 12:55:13 +0000 (UTC) Received: from bart.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1206910074F8 for ; Wed, 25 Aug 2021 12:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629896129; 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=UKx1EzJiXvOA1ZCbtmzP/S227uYNXbyy4Z4BC6JRirs=; b=WzF7gpZvGelkhO6igUerd1ZZzje85lzCetKQ1RjUjY9eU5qERu5+76v6ZMhhCzd+fE0JuV lwo1HAIltaZcCJR04NwxDigFAa0KVvKfSsDM5oU49LgVDTcaqa2dmgX3DHH2RqHDgEC77s B1WYP8brzIDgM/8zmRyxmIWyNXjUI1M= X-MC-Unique: pD69N31QOKqUMZ9YYt5tSw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] DO NOT MERGE Date: Wed, 25 Aug 2021 14:54:59 +0200 Message-Id: <4bff1f12e4653f374979a0d54381c41e8e432923.1629895768.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.16 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: 1629896131466100001 Content-Type: text/plain; charset="utf-8" This patch is intentionally wrong (it's leaking memory). I just include it to illustrate Clang bug. Signed-off-by: Michal Privoznik --- src/rpc/virnetclient.c | 9 ++++++--- src/util/viridentity.c | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index ffe2f343f9..eb215f13db 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -882,7 +882,7 @@ virNetClientIOEventTLS(int fd, static gboolean virNetClientTLSHandshake(virNetClient *client) { - g_autoptr(GSource) source =3D NULL; + GSource *source =3D NULL; GIOCondition ev; int ret; =20 @@ -901,6 +901,7 @@ virNetClientTLSHandshake(virNetClient *client) ev, client->eventCtx, virNetClientIOEventTLS, client, NU= LL); + g_source_unref(source); =20 return TRUE; } @@ -939,7 +940,7 @@ int virNetClientSetTLSSession(virNetClient *client, int ret; char buf[1]; int len; - g_autoptr(GSource) source =3D NULL; + GSource *source =3D NULL; =20 #ifndef WIN32 sigset_t oldmask, blockedsigs; @@ -1028,6 +1029,7 @@ int virNetClientSetTLSSession(virNetClient *client, virObjectUnref(client->tls); client->tls =3D NULL; virObjectUnlock(client); + g_source_unref(source); return -1; } =20 @@ -1664,7 +1666,7 @@ static int virNetClientIOEventLoop(virNetClient *clie= nt, #endif /* !WIN32 */ int timeout =3D -1; virNetMessage *msg =3D NULL; - g_autoptr(GSource) source =3D NULL; + GSource *source =3D NULL; GIOCondition ev =3D 0; struct virNetClientIOEventData data =3D { .client =3D client, @@ -1810,6 +1812,7 @@ static int virNetClientIOEventLoop(virNetClient *clie= nt, virNetClientMarkClose(client, closeReason); goto error; } + g_source_unref(source); } =20 error: diff --git a/src/util/viridentity.c b/src/util/viridentity.c index e36e54ae4b..dbaacd6da5 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -134,12 +134,13 @@ virIdentity *virIdentityGetCurrent(void) */ int virIdentitySetCurrent(virIdentity *ident) { - g_autoptr(virIdentity) old =3D NULL; + virIdentity *old =3D NULL; =20 if (virIdentityInitialize() < 0) return -1; =20 old =3D virThreadLocalGet(&virIdentityCurrent); + g_clear_object(&old); =20 if (virThreadLocalSet(&virIdentityCurrent, ident ? g_object_ref(ident) : NULL) < 0) { --=20 2.31.1