aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2023-09-28 15:19:37 +0200
committerJuan Quintela <quintela@redhat.com>2023-10-11 11:17:03 +0200
commitb16defbbfe3ffe9601edda4f7886a295dea8f408 (patch)
tree18667ad123588eb2d9033e08d2957f797ae1906e
parent3c03f21cb5ee0ded870987ea32217297f639afa0 (diff)
downloadqemu-b16defbbfe3ffe9601edda4f7886a295dea8f408.zip
qemu-b16defbbfe3ffe9601edda4f7886a295dea8f408.tar.gz
qemu-b16defbbfe3ffe9601edda4f7886a295dea8f408.tar.bz2
migration/rdma: Eliminate error_propagate()
When all we do with an Error we receive into a local variable is propagating to somewhere else, we can just as well receive it there right away. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Li Zhijian <lizhijian@fujitsu.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20230928132019.2544702-12-armbru@redhat.com>
-rw-r--r--migration/rdma.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/migration/rdma.c b/migration/rdma.c
index bc6d824..c858d3f 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2465,7 +2465,6 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
static int qemu_rdma_source_init(RDMAContext *rdma, bool pin_all, Error **errp)
{
int ret, idx;
- Error *local_err = NULL, **temp = &local_err;
/*
* Will be validated against destination's actual capabilities
@@ -2473,14 +2472,14 @@ static int qemu_rdma_source_init(RDMAContext *rdma, bool pin_all, Error **errp)
*/
rdma->pin_all = pin_all;
- ret = qemu_rdma_resolve_host(rdma, temp);
+ ret = qemu_rdma_resolve_host(rdma, errp);
if (ret) {
goto err_rdma_source_init;
}
ret = qemu_rdma_alloc_pd_cq(rdma);
if (ret) {
- ERROR(temp, "rdma migration: error allocating pd and cq! Your mlock()"
+ ERROR(errp, "rdma migration: error allocating pd and cq! Your mlock()"
" limits may be too low. Please check $ ulimit -a # and "
"search for 'ulimit -l' in the output");
goto err_rdma_source_init;
@@ -2488,13 +2487,13 @@ static int qemu_rdma_source_init(RDMAContext *rdma, bool pin_all, Error **errp)
ret = qemu_rdma_alloc_qp(rdma);
if (ret) {
- ERROR(temp, "rdma migration: error allocating qp!");
+ ERROR(errp, "rdma migration: error allocating qp!");
goto err_rdma_source_init;
}
ret = qemu_rdma_init_ram_blocks(rdma);
if (ret) {
- ERROR(temp, "rdma migration: error initializing ram blocks!");
+ ERROR(errp, "rdma migration: error initializing ram blocks!");
goto err_rdma_source_init;
}
@@ -2509,7 +2508,7 @@ static int qemu_rdma_source_init(RDMAContext *rdma, bool pin_all, Error **errp)
for (idx = 0; idx < RDMA_WRID_MAX; idx++) {
ret = qemu_rdma_reg_control(rdma, idx);
if (ret) {
- ERROR(temp, "rdma migration: error registering %d control!",
+ ERROR(errp, "rdma migration: error registering %d control!",
idx);
goto err_rdma_source_init;
}
@@ -2518,7 +2517,6 @@ static int qemu_rdma_source_init(RDMAContext *rdma, bool pin_all, Error **errp)
return 0;
err_rdma_source_init:
- error_propagate(errp, local_err);
qemu_rdma_cleanup(rdma);
return -1;
}
@@ -4111,7 +4109,6 @@ void rdma_start_incoming_migration(const char *host_port, Error **errp)
{
int ret;
RDMAContext *rdma;
- Error *local_err = NULL;
trace_rdma_start_incoming_migration();
@@ -4121,13 +4118,12 @@ void rdma_start_incoming_migration(const char *host_port, Error **errp)
return;
}
- rdma = qemu_rdma_data_init(host_port, &local_err);
+ rdma = qemu_rdma_data_init(host_port, errp);
if (rdma == NULL) {
goto err;
}
- ret = qemu_rdma_dest_init(rdma, &local_err);
-
+ ret = qemu_rdma_dest_init(rdma, errp);
if (ret) {
goto err;
}
@@ -4150,7 +4146,6 @@ void rdma_start_incoming_migration(const char *host_port, Error **errp)
cleanup_rdma:
qemu_rdma_cleanup(rdma);
err:
- error_propagate(errp, local_err);
if (rdma) {
g_free(rdma->host);
g_free(rdma->host_port);