* Zhimin Feng (fengzhim...@huawei.com) wrote: > Transmit initial packet through the multifd RDMA channels, > so that we can identify the multifd channels. > > Signed-off-by: Zhimin Feng <fengzhim...@huawei.com> > --- > migration/multifd.c | 33 +++++++++++++++++++++------------ > migration/rdma.c | 2 ++ > 2 files changed, 23 insertions(+), 12 deletions(-) > > diff --git a/migration/multifd.c b/migration/multifd.c > index acdfd3d5b3..a57d7a2eab 100644 > --- a/migration/multifd.c > +++ b/migration/multifd.c > @@ -483,6 +483,13 @@ void multifd_send_sync_main(QEMUFile *f) > static void *multifd_rdma_send_thread(void *opaque) > { > MultiFDSendParams *p = opaque; > + Error *local_err = NULL; > + > + trace_multifd_send_thread_start(p->id); > + > + if (multifd_send_initial_packet(p, &local_err) < 0) { > + goto out; > + } > > while (true) { > qemu_mutex_lock(&p->mutex); > @@ -494,6 +501,12 @@ static void *multifd_rdma_send_thread(void *opaque) > qemu_sem_wait(&p->sem); > } > > +out: > + if (local_err) { > + trace_multifd_send_error(p->id); > + multifd_send_terminate_threads(local_err); > + } > + > qemu_mutex_lock(&p->mutex); > p->running = false; > qemu_mutex_unlock(&p->mutex); > @@ -964,18 +977,14 @@ bool multifd_recv_new_channel(QIOChannel *ioc, Error > **errp) > Error *local_err = NULL; > int id; > > - if (migrate_use_rdma()) { > - id = multifd_recv_state->count; > - } else { > - id = multifd_recv_initial_packet(ioc, &local_err); > - if (id < 0) { > - multifd_recv_terminate_threads(local_err); > - error_propagate_prepend(errp, local_err, > - "failed to receive packet" > - " via multifd channel %d: ", > - atomic_read(&multifd_recv_state->count)); > - return false; > - } > + id = multifd_recv_initial_packet(ioc, &local_err); > + if (id < 0) { > + multifd_recv_terminate_threads(local_err); > + error_propagate_prepend(errp, local_err, > + "failed to receive packet" > + " via multifd channel %d: ", > + atomic_read(&multifd_recv_state->count)); > + return false;
I'm confused; hasn't that just undone part of patch 5 ? Dave > } > > trace_multifd_recv_new_channel(id); > diff --git a/migration/rdma.c b/migration/rdma.c > index 48615fcaad..2f1e69197f 100644 > --- a/migration/rdma.c > +++ b/migration/rdma.c > @@ -4003,6 +4003,8 @@ int multifd_channel_rdma_connect(void *opaque) > goto out; > } > > + p->c = QIO_CHANNEL(getQIOChannel(p->file)); > + > out: > if (local_err) { > trace_multifd_send_error(p->id); > -- > 2.19.1 > > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK