From nobody Wed Nov 27 12:21:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1550672749565766.2314787279182; Wed, 20 Feb 2019 06:25:49 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id F32902DA993; Wed, 20 Feb 2019 14:25: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 614046532B; Wed, 20 Feb 2019 14:25:45 +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 0E21B3FB11; Wed, 20 Feb 2019 14:25:45 +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 x1KEPfsW017149 for ; Wed, 20 Feb 2019 09:25:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 447465D723; Wed, 20 Feb 2019 14:25:41 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B97D45D71A for ; Wed, 20 Feb 2019 14:25:40 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 20 Feb 2019 15:24:59 +0100 Message-Id: <20190220142500.9810-4-abologna@redhat.com> In-Reply-To: <20190220142500.9810-1-abologna@redhat.com> References: <20190220142500.9810-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 3/4] util: Move error reporting back to virFileWrapperFdClose() 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 20 Feb 2019 14:25:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" virFileWrapperFdFree(), like all free functions, is supposed to only release allocated resources, so error reporting is better suited for virFileWrapperFdClose(). This reverts commit b0c3e931804a86cd7146db0164ab4843039c410b. Signed-off-by: Andrea Bolognani --- src/util/virfile.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 42add5a2cd..d35206b0dd 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -337,6 +337,9 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd) =20 ret =3D virCommandWait(wfd->cmd, NULL); =20 + if (wfd->err_msg && *wfd->err_msg) + VIR_WARN("iohelper reports: %s", wfd->err_msg); + wfd->closed =3D true; =20 return ret; @@ -357,11 +360,6 @@ virFileWrapperFdFree(virFileWrapperFdPtr wfd) if (!wfd) return; =20 - if (wfd->err_msg && *wfd->err_msg) - VIR_WARN("iohelper reports: %s", wfd->err_msg); - - virCommandAbort(wfd->cmd); - VIR_FREE(wfd->err_msg); virCommandFree(wfd->cmd); VIR_FREE(wfd); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list