From nobody Thu May 9 05:16:35 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=1646313114; cv=none; d=zohomail.com; s=zohoarc; b=lu908XviDeXoftMIT4QfKBUONijak9nr7p3ej1f5Q4kehRLpdVbL6jN5m3EfWabRIPh0gRNj9cUWK/ErXa9As5I03hP/N3+vW6VuR1LzYpU04JejPmOm3xr2KRrmhScpEvt888ZHMsOwwIbxBRSFeEaNB8lp7Z1xO+Yww/n0bxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646313114; 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=37DHiM91CAe34ZNx7p68CD5L7gxaLhShQRuiyGa/qe8=; b=db8MNA0q244xc4PAsN5CRLW54dB+3Lwxyw1O+6DEIlOEKSudvrZKi4V0xmWvxXfwINCSGcXlmXtgndgkS7+CMKtZu1abmGTepGFJ2VFdFL81xZU31+POXOImjf3+v/VwzsIgeAAMtA3JbJJlY8nh4r5RdJ9QGNQDpFQ+SBjbFZ4= 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 1646313114670479.59537418163484; Thu, 3 Mar 2022 05:11:54 -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-202-mI_hB752MgWfSHHOy8l64w-1; Thu, 03 Mar 2022 08:11:51 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9FBA61854E21; Thu, 3 Mar 2022 13:11:46 +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 036227B8E2; Thu, 3 Mar 2022 13:11: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 91B441809C83; Thu, 3 Mar 2022 13:11:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 223D9M3B019987 for ; Thu, 3 Mar 2022 08:09:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 40A8881F7A; Thu, 3 Mar 2022 13:09:22 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4C9378352 for ; Thu, 3 Mar 2022 13:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646313114; 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=37DHiM91CAe34ZNx7p68CD5L7gxaLhShQRuiyGa/qe8=; b=PnaMDTFoEuoK726qPwavyhxl88y7H1fGdqKjiP9ttTcTmbaGuZPP5aqGD0+AvTOrrmWaTh nlLm0Au+kYLSaD98JEiweSrQhfEQizGtDoRF+ZcF54fbMoK7L3egCpRiga7eKouVciSP7B +m3ZokjVUP6zGyUekDH8DzMfFyxgvDs= X-MC-Unique: mI_hB752MgWfSHHOy8l64w-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] remote: close outfiles faster Date: Thu, 3 Mar 2022 14:08:50 +0100 Message-Id: <66ace3505f73712e17cd04fdab6cf8ad693ce44a.1646312916.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.14 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: 1646313117286100001 Switch the operands in the loop condition to make it converge. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- src/remote/remote_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index d6295f32e9..7e7a21fcab 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -5977,7 +5977,7 @@ remoteDomainQemuMonitorCommandWithFiles(virDomainPtr = domain, =20 done: if (rpc_outfiles) { - for (i =3D 0; rpc_noutfiles < i; i++) { + for (i =3D 0; i < rpc_noutfiles; i++) { VIR_FORCE_CLOSE(rpc_outfiles[i]); } } --=20 2.34.1 From nobody Thu May 9 05:16:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1646313121; cv=none; d=zohomail.com; s=zohoarc; b=NchhDdN/eQAxuIhA03Efd7NAcFdPXMdrnPVP9yFd3GVAIIxk8VrbHGx/fkx3entD+JVDKJrG2QcTu//QnVJ9nSy0bSU5bfbZEiV98xKXfNBxY3oe51UiBf+OaN4a0qeIgSVikBBgs2br+krdjirYI5QqC3GDIm0qkvVBHDj1Y4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646313121; 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=L8+F/MRwiZD0YcB3vCOQQ9kBST4ei/9lD6hW57+/lMQ=; b=gDCZ0dKzQFQg3CbiAfvF4O/06V9RbNOEp9tr0aZ5ewV7SiHNRL8sYhJwlTA4QFKQMpNEyXeuqWo4d48fxb/oHju3B3+Cfnbpe+vuGQB3SMPKG4OtCsGKTmXqNRnZ/SS7UGoh9iYmpXjKdQetr9K1fO3FLaHcx/ZQyHSrtgx6NdM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1646313121843864.5420034908433; Thu, 3 Mar 2022 05:12:01 -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-137-06mTbI-dOcSBop00gS-ocQ-1; Thu, 03 Mar 2022 08:11:57 -0500 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 7FA5A1854E2A; Thu, 3 Mar 2022 13:11:52 +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 5F715797CD; Thu, 3 Mar 2022 13:11:52 +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 3530EE21B; Thu, 3 Mar 2022 13:11:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 223D9Nep019992 for ; Thu, 3 Mar 2022 08:09:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 463B678352; Thu, 3 Mar 2022 13:09:23 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id AACEF83BE4 for ; Thu, 3 Mar 2022 13:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646313120; 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=L8+F/MRwiZD0YcB3vCOQQ9kBST4ei/9lD6hW57+/lMQ=; b=Sz/6ExQgEoUFpyVnWHWDbsBqMSlPHeQefZu/ABu3xdiPlfG39xJGC/mm3YHt8d0cLYwMs/ xQlVz4JALdM3XHD70LpMu6Fbo5biGaSDxDifQ262VelaxWS0ZtwkwYKDdpi4oW7sr9HfJo wkChccWrm7WtbpXp1qvTv1ytTQh0txs= X-MC-Unique: 06mTbI-dOcSBop00gS-ocQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] remote: dispatch: free and close infiles too Date: Thu, 3 Mar 2022 14:08:51 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: 1646313122930100001 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- src/remote/remote_daemon_dispatch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index 510856024c..e468bbf261 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -4693,7 +4693,7 @@ qemuDispatchDomainMonitorCommandWithFiles(virNetServe= r *server G_GNUC_UNUSED, qemu_domain_monitor_command_with= _files_ret *ret) { virDomainPtr dom =3D NULL; - int *infiles =3D NULL; + g_autofree int *infiles =3D NULL; unsigned int ninfiles =3D 0; int *outfiles =3D NULL; unsigned int noutfiles =3D 0; @@ -4736,6 +4736,9 @@ qemuDispatchDomainMonitorCommandWithFiles(virNetServe= r *server G_GNUC_UNUSED, rv =3D 0; =20 cleanup: + for (i =3D 0; i < ninfiles; i++) + VIR_FORCE_CLOSE(infiles[i]); + for (i =3D 0; i < noutfiles; i++) VIR_FORCE_CLOSE(outfiles[i]); =20 --=20 2.34.1