Close all sockets before cancelling QEMU migration

Cancelling the QEMU migration may cause QEMU to flush pending
data on the migration socket. This may in turn block QEMU if
nothing reads from the other end of the socket. Closing the
socket before cancelling QEMU migration avoids this possible
deadlock.

* src/qemu/qemu_migration.c: Close sockets before cancelling
  migration on failure
This commit is contained in:
Daniel P. Berrange 2011-04-21 17:23:13 +01:00
parent 74f332468d
commit 2bf92bb829

View File

@ -1494,6 +1494,8 @@ static int doTunnelMigrate(struct qemud_driver *driver,
cancel:
if (ret != 0 && virDomainObjIsActive(vm)) {
VIR_FORCE_CLOSE(client_sock);
VIR_FORCE_CLOSE(qemu_sock);
qemuDomainObjEnterMonitorWithDriver(driver, vm);
qemuMonitorMigrateCancel(priv->mon);
qemuDomainObjExitMonitorWithDriver(driver, vm);