diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index f2b421eaef..64f0d8df1c 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4689,6 +4689,8 @@ qemuMigrationFinish(virQEMUDriverPtr driver, cleanup: virPortAllocatorRelease(driver->migrationPorts, port); if (vm) { + if (priv->mon) + qemuMonitorSetDomainLog(priv->mon, -1); VIR_FREE(priv->origname); virObjectUnlock(vm); } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index d96b1b80cf..702404a0ec 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -631,8 +631,11 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) error = true; } else { if (events & VIR_EVENT_HANDLE_WRITABLE) { - if (qemuMonitorIOWrite(mon) < 0) + if (qemuMonitorIOWrite(mon) < 0) { error = true; + if (errno == ECONNRESET) + hangup = true; + } events &= ~VIR_EVENT_HANDLE_WRITABLE; } @@ -642,6 +645,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) events &= ~VIR_EVENT_HANDLE_READABLE; if (got < 0) { error = true; + if (errno == ECONNRESET) + hangup = true; } else if (got == 0) { eof = true; } else { @@ -683,8 +688,9 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) if (hangup) { /* Check if an error message from qemu is available and if so, use * it to overwrite the actual message. It's done only in early - * startup phases where the message from qemu is certainly more - * interesting than a "connection reset by peer" message. + * startup phases or during incoming migration when the message + * from qemu is certainly more interesting than a + * "connection reset by peer" message. */ char *qemuMessage; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 38ed3fee63..b1d8a324dd 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4379,8 +4379,10 @@ int qemuProcessStart(virConnectPtr conn, goto cleanup; } - /* unset reporting errors from qemu log */ - qemuMonitorSetDomainLog(priv->mon, -1); + /* Keep watching qemu log for errors during incoming migration, otherwise + * unset reporting errors from qemu log. */ + if (!migrateFrom) + qemuMonitorSetDomainLog(priv->mon, -1); virCommandFree(cmd); VIR_FORCE_CLOSE(logfile);