From nobody Sun Apr 28 13:17:11 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=1630783855; cv=none; d=zohomail.com; s=zohoarc; b=eBKYpooDA2WTRZ/1NYsKv5T+p9nk/djLFnOHJyXmPMdguTJkiUP2S4BwVSkR4qIKjBT2Wkk/W18SsdojNjq65fBW9mXWtI52ewwusURl2YCduLni7gq1HnpagRJhZqueprJrD8JE9b+6wiJykbINISx00TDoOcNIcs8FGPWDJ3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630783855; 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=sDHVMGdelE6y3aCj6w+1t63Hp7Wk8/KVFjUZ9Vg3LGA=; b=LuMitr+zpQH1dhwAEYeWh22Vaumpw5Xb5qSg5oFQrA7RG7COwcinZ2+HNjnxTARJQq1PbL87wKqD9eUIx7cREgtfhsj6GjRHeOZdT90qjmKX8jZ8tZN3e19nltQhMJhcrKHeTAVF5qrIHbnFV7q5o6Z1RzN/Uvpx2RRxHYyt8aU= 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 1630783855273719.877553128609; Sat, 4 Sep 2021 12:30:55 -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-473-LPTUFxOtOeu-WGQCpFufQg-1; Sat, 04 Sep 2021 15:30:52 -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 6F11E80292A; Sat, 4 Sep 2021 19:30:45 +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 91B7010074E1; Sat, 4 Sep 2021 19:30:43 +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 A761F4EEA1; Sat, 4 Sep 2021 19:30:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 184JPtrN001928 for ; Sat, 4 Sep 2021 15:25:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id CDF4F5D740; Sat, 4 Sep 2021 19:25:55 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 585325D6A1 for ; Sat, 4 Sep 2021 19:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630783854; 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=sDHVMGdelE6y3aCj6w+1t63Hp7Wk8/KVFjUZ9Vg3LGA=; b=IJC/GYnOOn33w2qBc+pDatp/voO7KsO1zqgSaOpz+pnkh6sDlu5IANqVrIMXEwy7xmltV2 JXDGRlmA3eHmOjJX4vjeFrdF7Q3LJbtJjcHVHOFagQObz2SuhJQo5um9jSWurmNCsUf1ev 2KJ7RzIghdu8/JA23Ef6fgdqD6Sp3lE= X-MC-Unique: LPTUFxOtOeu-WGQCpFufQg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] qemu: remove unused 'cfg' variables Date: Sat, 4 Sep 2021 21:25:46 +0200 Message-Id: <00f7b34b0fbd7fd2b1af8252520e8ce47a73c694.1630783290.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630783856433100001 Unused as of: commit effeee5c2fcec19fcaad627690a6a0ba0025e35f qemu: driver: Use 'qemuDomainSaveStatus' for saving status XML This function extracts the config from the vm object, so the caller no longer needs to do it. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f1f961c51c..dfffd6b373 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1837,7 +1837,6 @@ static int qemuDomainSuspend(virDomainPtr dom) qemuDomainObjPrivate *priv; virDomainPausedReason reason; int state; - g_autoptr(virQEMUDriverConfig) cfg =3D NULL; =20 if (!(vm =3D qemuDomainObjFromDomain(dom))) return -1; @@ -1845,7 +1844,6 @@ static int qemuDomainSuspend(virDomainPtr dom) if (virDomainSuspendEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - cfg =3D virQEMUDriverGetConfig(driver); priv =3D vm->privateData; =20 if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_SUSPEND) < 0) @@ -1890,13 +1888,10 @@ static int qemuDomainResume(virDomainPtr dom) int ret =3D -1; int state; int reason; - g_autoptr(virQEMUDriverConfig) cfg =3D NULL; =20 if (!(vm =3D qemuDomainObjFromDomain(dom))) return -1; =20 - cfg =3D virQEMUDriverGetConfig(driver); - if (virDomainResumeEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 @@ -20237,8 +20232,6 @@ qemuDomainAgentSetResponseTimeout(virDomainPtr dom, int timeout, unsigned int flags) { - virQEMUDriver *driver =3D dom->conn->privateData; - g_autoptr(virQEMUDriverConfig) cfg =3D NULL; virDomainObj *vm =3D NULL; int ret =3D -1; =20 @@ -20255,8 +20248,6 @@ qemuDomainAgentSetResponseTimeout(virDomainPtr dom, if (!(vm =3D qemuDomainObjFromDomain(dom))) return -1; =20 - cfg =3D virQEMUDriverGetConfig(driver); - if (virDomainAgentSetResponseTimeoutEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 --=20 2.31.1 From nobody Sun Apr 28 13:17:11 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=1630783923; cv=none; d=zohomail.com; s=zohoarc; b=emL7X7LUXY9R4dnYkJFiV6LTqzYSvaDmk01rF3gC/p0qt51/o3LbVBTyfgfjMrQlLVI7wOHdCJ12iXc9rOdcMfdpyItaLgZxp1apGCJEC1FoCBTae6aN8YiaM+OWJPiad8yLPaetC8BlrK67VtQtl9m1NVdv85nTYPhyDWrt+Ac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630783923; 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=vHDiSd3A7rYQCCLeaIdONPld0tDbDxWxAMHI1+Qzg+o=; b=fRFz9Fp2SgGKYntNU7N926zJmUvcOjvLRhpyTDGp516gM+imJmbgCaExJg7wSWzTMPA6y6X4DKFxsYhJS+ooyDVJJl1dxuYrVtjcDtf9zwtLrDl8OYWcMawTunF6aI8wXbXD86o1X6CA3oBpFuDnn7efKRtDxzf6B/IdR/cvlS4= 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 163078392362316.074082425958295; Sat, 4 Sep 2021 12:32:03 -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-595-8MhaXoMoOh-jsr4jTnQVPQ-1; Sat, 04 Sep 2021 15:31:14 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E14AB5122; Sat, 4 Sep 2021 19:31:08 +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 12F26604CC; Sat, 4 Sep 2021 19:31:07 +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 9C77444A5A; Sat, 4 Sep 2021 19:31:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 184JPuIE001938 for ; Sat, 4 Sep 2021 15:25:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B8D35D740; Sat, 4 Sep 2021 19:25:56 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 257FC5D6A1 for ; Sat, 4 Sep 2021 19:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630783922; 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=vHDiSd3A7rYQCCLeaIdONPld0tDbDxWxAMHI1+Qzg+o=; b=AVeh4Ar1IGBeczAnCldvTLICbA3rs+CjwWVISIOHsTlaZU6fNVtSWx5CgxONm+eaKoX5R3 EGokUBR4dmbfj288jqDANN+My3OXSp2v1E4cX4OjceNmTmICOn91wSiQpffSwOR5fFBf5f V1jGQldmGZj47zPTRgKCQMLXluy/TGg= X-MC-Unique: 8MhaXoMoOh-jsr4jTnQVPQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] util: virIdentitySetCurrent: only unref the old identity on success Date: Sat, 4 Sep 2021 21:25:47 +0200 Message-Id: <411606b48a40920356f3e78747451b470456f717.1630783290.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630783925358100001 In the unlikely case that we were unable to set the new identity, we would unref the old one even though it still could be in the thread-local storage. Fixes: c6825d88137cb8e4debdf4310e45ee23cb5698c0 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/util/viridentity.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/viridentity.c b/src/util/viridentity.c index e36e54ae4b..70843ecf9f 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -134,7 +134,7 @@ virIdentity *virIdentityGetCurrent(void) */ int virIdentitySetCurrent(virIdentity *ident) { - g_autoptr(virIdentity) old =3D NULL; + virIdentity *old =3D NULL; =20 if (virIdentityInitialize() < 0) return -1; @@ -150,6 +150,8 @@ int virIdentitySetCurrent(virIdentity *ident) return -1; } =20 + if (old) + g_object_unref(old); return 0; } =20 --=20 2.31.1 From nobody Sun Apr 28 13:17:11 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=1630784308; cv=none; d=zohomail.com; s=zohoarc; b=Lq6c41jgKGZ6OzB+aGBHtG8rQkdgn2paGDxrWc2G/fU3obVGryIqp5UWHUGaUCkSAeU0Vc4pjnoIM38bFezrShTk/H7hcT0JBnwYCXzN9tYEVi/65YK+qi4JeKe9hyuLVYtbY8S34Izt0JdGUKdFrpIAI3+7sSX/yeLFv287EyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630784308; 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=aLyr1uNcHA1amY/RvAg+zo67jbsU986Y5QgG5+eVEe8=; b=PXoh9TDjLW96CV5/vZ1ueu8hlT9+Pryw5oJZ4sW8hJMJu7oTAvsAaOphVulu8uoNZbIFV8W9II7zY4LWkivpmFywMUtWMo4JvdhlVsJv4v66tx4O2vTWtoMWixpKDdTqf9H7GLElecdyT9kc2pasM9zmhYD5+ii/+uR2WMp+4zw= 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 163078430870934.504017512269684; Sat, 4 Sep 2021 12:38: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-162-tZh6IT3iPxOakxte7YD4rA-1; Sat, 04 Sep 2021 15:38:24 -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 3BA5D107ACCD; Sat, 4 Sep 2021 19:38:20 +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 1DE7560BF1; Sat, 4 Sep 2021 19:38:20 +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 E5BFD44A5D; Sat, 4 Sep 2021 19:38:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 184JPvRI001943 for ; Sat, 4 Sep 2021 15:25:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 692675D740; Sat, 4 Sep 2021 19:25:57 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7BF35D6A1 for ; Sat, 4 Sep 2021 19:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630784307; 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=aLyr1uNcHA1amY/RvAg+zo67jbsU986Y5QgG5+eVEe8=; b=cdtdC+wOph3O6hsxbq4WKiHLWGl2d9EyvDbbxRngJj6g6JmB1upzaYXFL6TrS8OV/+61yl uf4grwkj8acPbVo2UVw8D31ppEI9R5Sg8H0fwwz6vcnux/3vgG59R6BcNB0Vmi13XGwWEX 7+OcKiXZfj6o3ZMefq43sBndh4lx8IM= X-MC-Unique: tZh6IT3iPxOakxte7YD4rA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] rpc: mark source returned by virEventGLibAddSocketWatch as unused Date: Sat, 4 Sep 2021 21:25:48 +0200 Message-Id: <8b3d097da1fe39d3d7f733c0f45f9430b2517a38.1630783290.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630784309798100001 Two users of virEventGLibAddSocketWatch care about the GSource it returns. The other three free it by assigning it to an autofreed variable. Mark them with G_GNUC_UNUSED to make this obvious to the reader and the compiler. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/rpc/virnetclient.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index ffe2f343f9..f526ad89ec 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; + g_autoptr(GSource) G_GNUC_UNUSED source =3D NULL; GIOCondition ev; int ret; =20 @@ -939,7 +939,7 @@ int virNetClientSetTLSSession(virNetClient *client, int ret; char buf[1]; int len; - g_autoptr(GSource) source =3D NULL; + g_autoptr(GSource) G_GNUC_UNUSED source =3D NULL; =20 #ifndef WIN32 sigset_t oldmask, blockedsigs; @@ -1664,7 +1664,7 @@ static int virNetClientIOEventLoop(virNetClient *clie= nt, #endif /* !WIN32 */ int timeout =3D -1; virNetMessage *msg =3D NULL; - g_autoptr(GSource) source =3D NULL; + g_autoptr(GSource) G_GNUC_UNUSED source =3D NULL; GIOCondition ev =3D 0; struct virNetClientIOEventData data =3D { .client =3D client, --=20 2.31.1 From nobody Sun Apr 28 13:17:11 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=1630784310; cv=none; d=zohomail.com; s=zohoarc; b=QQrvHN9zROSTGjzMBCkwdFsaP4eWqKavyiOPab1P+KFW4cJD1a19zjWdMHbUZ1zFQt8nRf2JJEN6kCOENsZCg8EAlbumtRfnvg0qVlaBrFa624gGO/Yy+AaNbSFTE8/t6HojLkmnCvxoU8nOxMNbI4Xuj2TivvYO1GuWpbChj2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630784310; 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=v/Zg77oKP2ztfhA+5O7RAFjeu6J++mR+ZItKp+I+sW0=; b=dp8/MG7JKmIqSmFM21g1/nhqqwI7rwhUY3QlMs1N4qQschMt+Ys8IAbV+QPyWMoz3L0lCgg8jB45h4zO4ugrbDd3Aq3hdFImXOP+fvAzfs5jQS0gSMQk6kU/mYyu70AvABOdYJ0DYWz1BE56mA1b3WEMTQBrKxSHy0xVXmKE8sU= 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 1630784310427627.0193575354332; Sat, 4 Sep 2021 12:38:30 -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-300-Xih16XKaPsKaIgLwDgydEQ-1; Sat, 04 Sep 2021 15:38:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 993CD107ACE8; Sat, 4 Sep 2021 19:38:22 +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 7FCDB60861; Sat, 4 Sep 2021 19:38:22 +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 537CE1806D0F; Sat, 4 Sep 2021 19:38:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 184JPwgd001956 for ; Sat, 4 Sep 2021 15:25:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 35FFF5D740; Sat, 4 Sep 2021 19:25:58 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4D615D6A1 for ; Sat, 4 Sep 2021 19:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630784309; 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=v/Zg77oKP2ztfhA+5O7RAFjeu6J++mR+ZItKp+I+sW0=; b=PkV3rHOD230GnuHlg8RVt/FJRx27uQxd4boFaVpgpdtfTrwNKK92fzq0QlS+JgeT/M4JcG vOK4To/cNOqfzwaQUwtTNGCqvsuNl4J+TFhKQgq7d4jLAI0F8cBFVM1r1tBTV4wVzX1W81 jt9QZhYBU/ycMJ5if2ntIwQji2CH76Q= X-MC-Unique: Xih16XKaPsKaIgLwDgydEQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] Revert "meson: avoid bogus warnings from clang and g_autoptr" Date: Sat, 4 Sep 2021 21:25:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.13 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630784311939100001 Commit 345996c6208b281233074362a8d81295e2e711d4 disabled the -Wunused-but-set-variable warning on CLang, beacuse it warned on variables that were unread, but we relied on the side effects of their destructors. Reinstate the warning now that all the occurrences have been fixed. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 2 +- meson.build | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 5c5a2a8771..2058af0b77 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1589,7 +1589,7 @@ exclude_file_name_regexp--sc_prohibit_canonicalize_fi= le_name =3D \ ^(build-aux/syntax-check\.mk|tests/virfilemock\.c)$$ =20 exclude_file_name_regexp--sc_prohibit_raw_allocation =3D \ - ^(meson\.build|docs/advanced-tests\.rst|src/util/viralloc\.[ch]|examples= /.*|tests/(securityselinuxhelper|(vircgroup|nss)mock|commandhelper)\.c|tool= s/wireshark/src/packet-libvirt\.c|tools/nss/libvirt_nss(_leases|_macs)?\.c)= $$ + ^(docs/advanced-tests\.rst|src/util/viralloc\.[ch]|examples/.*|tests/(se= curityselinuxhelper|(vircgroup|nss)mock|commandhelper)\.c|tools/wireshark/s= rc/packet-libvirt\.c|tools/nss/libvirt_nss(_leases|_macs)?\.c)$$ =20 exclude_file_name_regexp--sc_prohibit_readlink =3D \ ^src/(util/virutil|lxc/lxc_container)\.c$$ diff --git a/meson.build b/meson.build index a8c99ac4b1..9d493ccd9e 100644 --- a/meson.build +++ b/meson.build @@ -470,27 +470,6 @@ if get_option('warning_level') =3D=3D '2' supported_cc_flags +=3D [ '-Wno-unused-function' ] endif =20 - if supported_cc_flags.contains('-Wunused-but-set-variable') - # Clang complains about unused variables in many scenarios related - # to attribute((cleanup)) aka g_auto* - w_unused_but_set_var_args =3D [ '-Wunused-but-set-variable', '-Werror'= ] - w_unused_but_set_var_code =3D ''' - static inline void free_pointer (void *p) { - void **pp =3D (void**)p; - free (*pp); - } - - int main(void) { - __attribute__((cleanup(free_pointer))) char *buffer =3D 0x0; - buffer =3D 0x1; - } - ''' - # We previously turned on unused-but-set-variable, so we must turn - # it off again explicitly now. - if not cc.compiles(w_unused_but_set_var_code, args: w_unused_but_set_v= ar_args) - supported_cc_flags +=3D [ '-Wno-unused-but-set-variable' ] - endif - endif endif add_project_arguments(supported_cc_flags, language: 'c') =20 --=20 2.31.1