提交 72adaf2f 编写于 作者: M Michal Privoznik

Revert "qemu: monitor: do not report error on shutdown"

https://bugzilla.redhat.com/show_bug.cgi?id=1536461

This reverts commit aeda1b8c.

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: NMichal Privoznik <mprivozn@redhat.com>
上级 0b54c37d
...@@ -78,7 +78,6 @@ struct _qemuMonitor { ...@@ -78,7 +78,6 @@ struct _qemuMonitor {
* < 0: an error occurred during the registration of @fd */ * < 0: an error occurred during the registration of @fd */
int watch; int watch;
int hasSendFD; int hasSendFD;
int willhangup;
virDomainObjPtr vm; virDomainObjPtr vm;
...@@ -716,10 +715,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) ...@@ -716,10 +715,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
if (events & VIR_EVENT_HANDLE_HANGUP) { if (events & VIR_EVENT_HANDLE_HANGUP) {
hangup = true; hangup = true;
if (!error) { if (!error) {
if (!mon->willhangup) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("End of file from qemu monitor"));
_("End of file from qemu monitor"));
}
eof = true; eof = true;
events &= ~VIR_EVENT_HANDLE_HANGUP; events &= ~VIR_EVENT_HANDLE_HANGUP;
} }
...@@ -758,7 +755,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) ...@@ -758,7 +755,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
if (mon->lastError.code != VIR_ERR_OK) { if (mon->lastError.code != VIR_ERR_OK) {
/* Already have an error, so clear any new error */ /* Already have an error, so clear any new error */
virResetLastError(); virResetLastError();
} else if (!mon->willhangup) { } else {
virErrorPtr err = virGetLastError(); virErrorPtr err = virGetLastError();
if (!err) if (!err)
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
...@@ -1352,7 +1349,6 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTristateBool guest) ...@@ -1352,7 +1349,6 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTristateBool guest)
{ {
int ret = -1; int ret = -1;
VIR_DEBUG("mon=%p guest=%u", mon, guest); VIR_DEBUG("mon=%p guest=%u", mon, guest);
mon->willhangup = 1;
QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm, guest); QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm, guest);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册