mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: monitor: do not report error on shutdown
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 <christian.ehrhardt@canonical.com>
This commit is contained in:
parent
ec337aee9b
commit
aeda1b8c56
@ -63,6 +63,7 @@ struct _qemuMonitor {
|
|||||||
int fd;
|
int fd;
|
||||||
int watch;
|
int watch;
|
||||||
int hasSendFD;
|
int hasSendFD;
|
||||||
|
int willhangup;
|
||||||
|
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
|
|
||||||
@ -693,8 +694,10 @@ 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) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
if (!mon->willhangup) {
|
||||||
_("End of file from qemu monitor"));
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("End of file from qemu monitor"));
|
||||||
|
}
|
||||||
eof = true;
|
eof = true;
|
||||||
events &= ~VIR_EVENT_HANDLE_HANGUP;
|
events &= ~VIR_EVENT_HANDLE_HANGUP;
|
||||||
}
|
}
|
||||||
@ -733,7 +736,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 {
|
} else if (!mon->willhangup) {
|
||||||
virErrorPtr err = virGetLastError();
|
virErrorPtr err = virGetLastError();
|
||||||
if (!err)
|
if (!err)
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
@ -1327,6 +1330,7 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon)
|
|||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
mon->willhangup = 1;
|
||||||
|
|
||||||
QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm);
|
QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user