migration: Create migration_has_all_channels

This function allows us to decide when to close the listener socket.
For now, we only need one connection.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Juan Quintela
2017-07-24 13:06:25 +02:00
parent 8e1a1931ca
commit 428d89084c
3 changed files with 20 additions and 3 deletions

View File

@@ -152,9 +152,13 @@ static gboolean socket_accept_incoming_migration(QIOChannel *ioc,
object_unref(OBJECT(sioc));
out:
/* Close listening socket as its no longer needed */
qio_channel_close(ioc, NULL);
return G_SOURCE_REMOVE;
if (migration_has_all_channels()) {
/* Close listening socket as its no longer needed */
qio_channel_close(ioc, NULL);
return G_SOURCE_REMOVE;
} else {
return G_SOURCE_CONTINUE;
}
}