qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

migration/rdma: rdma_accept_incoming_migration fix error handling

rdma_accept_incoming_migration is called from an fd handler and
can't return an Error * anywhere.
Currently it's leaking Error's in errp/local_err - there's
no point putting them in there unless we can report them.

Turn most into fprintf's, and the last into an error_reportf_err
where it's coming up from another function.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>

authored by

Dr. David Alan Gilbert and committed by
Juan Quintela
2a1bc8bd d05de9e3

+7 -4
+7 -4
migration/rdma.c
··· 3980 3980 RDMAContext *rdma = opaque; 3981 3981 int ret; 3982 3982 QEMUFile *f; 3983 - Error *local_err = NULL, **errp = &local_err; 3983 + Error *local_err = NULL; 3984 3984 3985 3985 trace_qemu_rdma_accept_incoming_migration(); 3986 3986 ret = qemu_rdma_accept(rdma); 3987 3987 3988 3988 if (ret) { 3989 - ERROR(errp, "RDMA Migration initialization failed!"); 3989 + fprintf(stderr, "RDMA ERROR: Migration initialization failed\n"); 3990 3990 return; 3991 3991 } 3992 3992 ··· 3998 3998 3999 3999 f = qemu_fopen_rdma(rdma, "rb"); 4000 4000 if (f == NULL) { 4001 - ERROR(errp, "could not qemu_fopen_rdma!"); 4001 + fprintf(stderr, "RDMA ERROR: could not qemu_fopen_rdma\n"); 4002 4002 qemu_rdma_cleanup(rdma); 4003 4003 return; 4004 4004 } 4005 4005 4006 4006 rdma->migration_started_on_destination = 1; 4007 - migration_fd_process_incoming(f, errp); 4007 + migration_fd_process_incoming(f, &local_err); 4008 + if (local_err) { 4009 + error_reportf_err(local_err, "RDMA ERROR:"); 4010 + } 4008 4011 } 4009 4012 4010 4013 void rdma_start_incoming_migration(const char *host_port, Error **errp)