Skip to content

Commit

Permalink
migration/tls: fix inverted semantics in multifd_channel_connect
Browse files Browse the repository at this point in the history
Function multifd_channel_connect() return "true" to indicate failure,
which is rather confusing. Fix that.

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Message-Id: <20210209104237.2250941-2-wanghao232@huawei.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Chuan Zheng <zhengchuan@huawei.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  • Loading branch information
HaoWang0113 authored and dagrh committed Mar 15, 2021
1 parent 03ccaaa commit a339149
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions migration/multifd.c
Expand Up @@ -798,20 +798,20 @@ static bool multifd_channel_connect(MultiFDSendParams *p,
* function after the TLS handshake,
* so we mustn't call multifd_send_thread until then
*/
return false;
} else {
return true;
} else {
return false;
}
} else {
/* update for tls qio channel */
p->c = ioc;
qemu_thread_create(&p->thread, p->name, multifd_send_thread, p,
QEMU_THREAD_JOINABLE);
}
return false;
return true;
}

return true;
return false;
}

static void multifd_new_send_channel_cleanup(MultiFDSendParams *p,
Expand Down Expand Up @@ -844,7 +844,7 @@ static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque)
p->c = QIO_CHANNEL(sioc);
qio_channel_set_delay(p->c, false);
p->running = true;
if (multifd_channel_connect(p, sioc, local_err)) {
if (!multifd_channel_connect(p, sioc, local_err)) {
goto cleanup;
}
return;
Expand Down

0 comments on commit a339149

Please sign in to comment.