From nobody Sat May 4 18:54:17 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 1516367467329165.88804804146992; Fri, 19 Jan 2018 05:11:07 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 4707CCD4CC; Fri, 19 Jan 2018 13:11:05 +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 EB32C60F8B; Fri, 19 Jan 2018 13:11:03 +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 3B47558A21; Fri, 19 Jan 2018 13:03:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0JD2dm3024391 for ; Fri, 19 Jan 2018 08:02:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 40FFB7E101; Fri, 19 Jan 2018 13:02:39 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id E49BF7E0BB; Fri, 19 Jan 2018 13:01:32 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 19 Jan 2018 14:00:44 +0100 Message-Id: <56a55e53f903100918df111e88e875d8d61b8f65.1516366844.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: harrykas@gmail.com, jtomko@redhat.com Subject: [libvirt] [PATCH] Revert "qemu: monitor: do not report error on shutdown" 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: , MIME-Version: 1.0 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 19 Jan 2018 13:11:06 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1. Problem is that we need mon->lastError to be set because it's used all over the place. Also, there's nothing wrong with reporting error if one occurred. I mean, if there's a thread executing an API and which currently is talking on monitor it definitely wants the error reported. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 85c7d68a1..fc146bdbf 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -78,7 +78,6 @@ struct _qemuMonitor { * < 0: an error occurred during the registration of @fd */ int watch; int hasSendFD; - int willhangup; =20 virDomainObjPtr vm; =20 @@ -716,10 +715,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opa= que) if (events & VIR_EVENT_HANDLE_HANGUP) { hangup =3D true; if (!error) { - if (!mon->willhangup) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("End of file from qemu monitor")); - } + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("End of file from qemu monitor")); eof =3D true; events &=3D ~VIR_EVENT_HANDLE_HANGUP; } @@ -758,7 +755,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaq= ue) if (mon->lastError.code !=3D VIR_ERR_OK) { /* Already have an error, so clear any new error */ virResetLastError(); - } else if (!mon->willhangup) { + } else { virErrorPtr err =3D virGetLastError(); if (!err) virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1352,7 +1349,6 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTrista= teBool guest) { int ret =3D -1; VIR_DEBUG("mon=3D%p guest=3D%u", mon, guest); - mon->willhangup =3D 1; =20 QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm, guest); return ret; --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list