]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Close all sockets before cancelling QEMU migration
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 21 Apr 2011 16:23:13 +0000 (17:23 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 16 May 2011 14:18:22 +0000 (15:18 +0100)
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

src/qemu/qemu_migration.c

index b132d860cd1748a00c2f7cb3111c5c9ac4bff504..0e9d2d2f4873eafa66e38b8892ac44f0549e2f78 100644 (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);