multifd: Use number of channels as listen backlog

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Juan Quintela 2019-08-19 18:14:44 +02:00
parent fc8135c630
commit 0705e56496

View File

@ -178,10 +178,15 @@ static void socket_start_incoming_migration(SocketAddress *saddr,
{ {
QIONetListener *listener = qio_net_listener_new(); QIONetListener *listener = qio_net_listener_new();
size_t i; size_t i;
int num = 1;
qio_net_listener_set_name(listener, "migration-socket-listener"); qio_net_listener_set_name(listener, "migration-socket-listener");
if (qio_net_listener_open_sync(listener, saddr, 1, errp) < 0) { if (migrate_use_multifd()) {
num = migrate_multifd_channels();
}
if (qio_net_listener_open_sync(listener, saddr, num, errp) < 0) {
object_unref(OBJECT(listener)); object_unref(OBJECT(listener));
return; return;
} }