mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
d05de9e39a
commit
2a1bc8bde7
|
@ -3980,13 +3980,13 @@ static void rdma_accept_incoming_migration(void *opaque)
|
||||||
RDMAContext *rdma = opaque;
|
RDMAContext *rdma = opaque;
|
||||||
int ret;
|
int ret;
|
||||||
QEMUFile *f;
|
QEMUFile *f;
|
||||||
Error *local_err = NULL, **errp = &local_err;
|
Error *local_err = NULL;
|
||||||
|
|
||||||
trace_qemu_rdma_accept_incoming_migration();
|
trace_qemu_rdma_accept_incoming_migration();
|
||||||
ret = qemu_rdma_accept(rdma);
|
ret = qemu_rdma_accept(rdma);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ERROR(errp, "RDMA Migration initialization failed!");
|
fprintf(stderr, "RDMA ERROR: Migration initialization failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3998,13 +3998,16 @@ static void rdma_accept_incoming_migration(void *opaque)
|
||||||
|
|
||||||
f = qemu_fopen_rdma(rdma, "rb");
|
f = qemu_fopen_rdma(rdma, "rb");
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
ERROR(errp, "could not qemu_fopen_rdma!");
|
fprintf(stderr, "RDMA ERROR: could not qemu_fopen_rdma\n");
|
||||||
qemu_rdma_cleanup(rdma);
|
qemu_rdma_cleanup(rdma);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rdma->migration_started_on_destination = 1;
|
rdma->migration_started_on_destination = 1;
|
||||||
migration_fd_process_incoming(f, errp);
|
migration_fd_process_incoming(f, &local_err);
|
||||||
|
if (local_err) {
|
||||||
|
error_reportf_err(local_err, "RDMA ERROR:");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdma_start_incoming_migration(const char *host_port, Error **errp)
|
void rdma_start_incoming_migration(const char *host_port, Error **errp)
|
||||||
|
|
Loading…
Reference in New Issue