render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
404507
From be2ee0f5055cff0fd449ce972935f1af8ebfee84 Mon Sep 17 00:00:00 2001
404507
Message-Id: <be2ee0f5055cff0fd449ce972935f1af8ebfee84@dist-git>
404507
From: Michal Privoznik <mprivozn@redhat.com>
404507
Date: Fri, 19 Jan 2018 14:35:17 +0100
404507
Subject: [PATCH] Revert "qemu: monitor: do not report error on shutdown"
404507
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1536461
404507
404507
This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1.
404507
404507
Problem is that we need mon->lastError to be set because it's
404507
used all over the place. Also, there's nothing wrong with
404507
reporting error if one occurred. I mean, if there's a thread
404507
executing an API and which currently is talking on monitor it
404507
definitely wants the error reported.
404507
404507
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
404507
(cherry picked from commit 72adaf2f10509c3682f2c65ffad4176e00e5a2fb)
404507
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
404507
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
404507
---
404507
 src/qemu/qemu_monitor.c | 10 +++-------
404507
 1 file changed, 3 insertions(+), 7 deletions(-)
404507
404507
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
404507
index 12ad45d340..b6af209a83 100644
404507
--- a/src/qemu/qemu_monitor.c
404507
+++ b/src/qemu/qemu_monitor.c
404507
@@ -69,7 +69,6 @@ struct _qemuMonitor {
404507
      * < 0: an error occurred during the registration of @fd */
404507
     int watch;
404507
     int hasSendFD;
404507
-    int willhangup;
404507
 
404507
     virDomainObjPtr vm;
404507
 
404507
@@ -701,10 +700,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
404507
         if (events & VIR_EVENT_HANDLE_HANGUP) {
404507
             hangup = true;
404507
             if (!error) {
404507
-                if (!mon->willhangup) {
404507
-                    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
404507
-                                   _("End of file from qemu monitor"));
404507
-                }
404507
+                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
404507
+                               _("End of file from qemu monitor"));
404507
                 eof = true;
404507
                 events &= ~VIR_EVENT_HANDLE_HANGUP;
404507
             }
404507
@@ -743,7 +740,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
404507
         if (mon->lastError.code != VIR_ERR_OK) {
404507
             /* Already have an error, so clear any new error */
404507
             virResetLastError();
404507
-        } else if (!mon->willhangup) {
404507
+        } else {
404507
             virErrorPtr err = virGetLastError();
404507
             if (!err)
404507
                 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
404507
@@ -1337,7 +1334,6 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTristateBool guest)
404507
 {
404507
     int ret = -1;
404507
     VIR_DEBUG("mon=%p guest=%u", mon, guest);
404507
-    mon->willhangup = 1;
404507
 
404507
     QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm, guest);
404507
     return ret;
404507
-- 
404507
2.16.1
404507