]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuMigrationRun: Don't leak @fd
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 14 Jul 2015 13:42:50 +0000 (15:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Jul 2015 09:40:41 +0000 (11:40 +0200)
If we are migrating to an UNIX socket, we accept() a connection
from qemu and use that FD to set up a tunnel. However, the FD is
not closed as often as it should be.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_migration.c

index d78911025a6f5ee72bc0b723f2908f10c068f09c..f5866c41210fdcdd5b85244ea04f28c2a6d33d1d 100644 (file)
@@ -4375,8 +4375,8 @@ qemuMigrationRun(virQEMUDriverPtr driver,
     if (spec->fwdType != MIGRATION_FWD_DIRECT) {
         if (iothread && qemuMigrationStopTunnel(iothread, ret < 0) < 0)
             ret = -1;
-        VIR_FORCE_CLOSE(fd);
     }
+    VIR_FORCE_CLOSE(fd);
 
     if (priv->job.completed) {
         qemuDomainJobInfoUpdateTime(priv->job.completed);