From nobody Fri Apr 26 21:30:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1489053497700579.2097511780321; Thu, 9 Mar 2017 01:58:17 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v299sdwi001615; Thu, 9 Mar 2017 04:54:40 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v299sc6w015409 for ; Thu, 9 Mar 2017 04:54:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3992A2D655; Thu, 9 Mar 2017 09:54:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 328AD2D653 for ; Thu, 9 Mar 2017 09:54:38 +0000 (UTC) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14FDF61D1E for ; Thu, 9 Mar 2017 09:54:37 +0000 (UTC) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1clumI-0002Jo-LJ; Thu, 09 Mar 2017 09:54:34 +0000 From: Christian Ehrhardt To: libvir-list@redhat.com Date: Thu, 9 Mar 2017 10:54:32 +0100 Message-Id: <1489053272-13524-1-git-send-email-christian.ehrhardt@canonical.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 09 Mar 2017 09:54:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 09 Mar 2017 09:54:37 +0000 (UTC) for IP:'91.189.89.112' DOMAIN:'youngberry.canonical.com' HELO:'youngberry.canonical.com' FROM:'christian.ehrhardt@canonical.com' RCPT:'' X-RedHat-Spam-Score: -1.501 (BAYES_50, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD) 91.189.89.112 youngberry.canonical.com 91.189.89.112 youngberry.canonical.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Cc: Seth Arnold , Christian Ehrhardt Subject: [libvirt] [RFC] 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If a shutdown is expected because it was triggered via libvirt we can also expect the monitor to close. In those cases do not report an internal error like: "internal error: End of file from qemu monitor" Signed-off-by: Christian Ehrhardt --- src/qemu/qemu_monitor.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index d71f84c..352cc8a 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -63,6 +63,7 @@ struct _qemuMonitor { int fd; int watch; int hasSendFD; + int willhangup; =20 virDomainObjPtr vm; =20 @@ -691,8 +692,10 @@ qemuMonitorIO(int watch, int fd, int events, void *opa= que) if (events & VIR_EVENT_HANDLE_HANGUP) { hangup =3D true; if (!error) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("End of file from qemu monitor")); + if (!mon->willhangup) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("End of file from qemu monitor")); + } eof =3D true; events &=3D ~VIR_EVENT_HANDLE_HANGUP; } @@ -731,7 +734,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 { + } else if (!mon->willhangup) { virErrorPtr err =3D virGetLastError(); if (!err) virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1282,6 +1285,7 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon) { int ret =3D -1; VIR_DEBUG("mon=3D%p", mon); + mon->willhangup =3D 1; =20 QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm); return ret; --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list