From nobody Sat May 4 14:59:45 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1532223677995317.6651160893542; Sat, 21 Jul 2018 18:41:17 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A2859308A947; Sun, 22 Jul 2018 01:41:09 +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 06D72608F2; Sun, 22 Jul 2018 01:41:06 +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 D71694A460; Sun, 22 Jul 2018 01:40:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6M1eurB000863 for ; Sat, 21 Jul 2018 21:40:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 175ED308BDB1; Sun, 22 Jul 2018 01:40:56 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19B91308BDAC; Sun, 22 Jul 2018 01:40:53 +0000 (UTC) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 00BDC81DE3; Sun, 22 Jul 2018 01:40:50 +0000 (UTC) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4C8CDB3C29DC; Sun, 22 Jul 2018 09:40:45 +0800 (CST) Received: from localhost (10.177.25.200) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Sun, 22 Jul 2018 09:40:38 +0800 From: "xinhua.Cao" To: , , , Date: Sun, 22 Jul 2018 09:40:35 +0800 Message-ID: <20180722014035.14808-1-caoxinhua@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.25.200] X-CFilter-Loop: Reflected X-Greylist: Sender passed SPF test, ACL 227 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 22 Jul 2018 01:40:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 22 Jul 2018 01:40:51 +0000 (UTC) for IP:'45.249.212.32' DOMAIN:'szxga06-in.huawei.com' HELO:'huawei.com' FROM:'caoxinhua@huawei.com' RCPT:'' X-RedHat-Spam-Score: -0.002 (SPF_HELO_PASS, SPF_PASS) 45.249.212.32 szxga06-in.huawei.com 45.249.212.32 szxga06-in.huawei.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: libvir-list@redhat.com Cc: liuyongan@huawei.com, "xinhua.Cao" , weidong.huang@huawei.com, king.wang@huawei.com, weifuqiang@huawei.com Subject: [libvirt] [PATCH] libvirt_iohelper: record the libvirt_iohelper's error message at virFileWrapperFdFree 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sun, 22 Jul 2018 01:41:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently iohelper's error log is recorded in virFileWrapperFdClose. In qemuDomainSaveMemory, it usually fails at qemuMigrationSrcToFile, and then goto cleanup, so the iohelper error log is not recorded, and so is the another placement. We now record the error log of iohelper by move it to the virFileWrapperFdFree record. There is another problem here, that is, virCommandWait is also not called, but I can't evaluate this impact. So no changes have been made here. --- src/util/virfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 1faeebb..30456ab 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -330,9 +330,6 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd) return 0; =20 ret =3D virCommandWait(wfd->cmd, NULL); - if (wfd->err_msg && *wfd->err_msg) - VIR_WARN("iohelper reports: %s", wfd->err_msg); - return ret; } =20 @@ -351,6 +348,9 @@ virFileWrapperFdFree(virFileWrapperFdPtr wfd) if (!wfd) return; =20 + if (wfd->err_msg && *wfd->err_msg) + VIR_WARN("iohelper reports: %s", wfd->err_msg); + VIR_FREE(wfd->err_msg); =20 virCommandFree(wfd->cmd); --=20 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list