[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/26] migration: Remove unnecessary usage of local Error
From: |
peterx |
Subject: |
[PULL 24/26] migration: Remove unnecessary usage of local Error |
Date: |
Thu, 4 Jan 2024 12:32:09 +0800 |
From: Avihai Horon <avihaih@nvidia.com>
According to Error API, usage of ERRP_GUARD() or a local Error instead
of errp is needed if errp is passed to void functions, where it is later
dereferenced to see if an error occurred.
There are several places in migration.c that use local Error although it
is not needed. Change these places to use errp directly.
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20231231093016.14204-11-avihaih@nvidia.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/migration.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 9524c22a50..454cd4ec1f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -830,10 +830,9 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error
**errp)
* issue is not possible.
*/
ret = migration_channel_read_peek(ioc, (void *)&channel_magic,
- sizeof(channel_magic), &local_err);
+ sizeof(channel_magic), errp);
if (ret != 0) {
- error_propagate(errp, local_err);
return;
}
@@ -1825,8 +1824,6 @@ bool migration_is_blocked(Error **errp)
static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
bool resume, Error **errp)
{
- Error *local_err = NULL;
-
if (blk_inc) {
warn_report("parameter 'inc' is deprecated;"
" use blockdev-mirror with NBD instead");
@@ -1896,8 +1893,7 @@ static bool migrate_prepare(MigrationState *s, bool blk,
bool blk_inc,
"current migration capabilities");
return false;
}
- if (!migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, true, &local_err)) {
- error_propagate(errp, local_err);
+ if (!migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, true, errp)) {
return false;
}
s->must_remove_block_options = true;
--
2.41.0
- [PULL 15/26] migration: Remove migrate_max_downtime() declaration, (continued)
- [PULL 15/26] migration: Remove migrate_max_downtime() declaration, peterx, 2024/01/03
- [PULL 17/26] migration: Refactor migration_incoming_setup(), peterx, 2024/01/03
- [PULL 16/26] migration: Remove nulling of hostname in migrate_init(), peterx, 2024/01/03
- [PULL 19/26] migration/multifd: Fix error message in multifd_recv_initial_packet(), peterx, 2024/01/03
- [PULL 18/26] migration: Remove errp parameter in migration_fd_process_incoming(), peterx, 2024/01/03
- [PULL 20/26] migration/multifd: Simplify multifd_channel_connect() if else statement, peterx, 2024/01/03
- [PULL 21/26] migration/multifd: Fix leaking of Error in TLS error flow, peterx, 2024/01/03
- [PULL 22/26] migration/multifd: Remove error_setg() in migration_ioc_process_incoming(), peterx, 2024/01/03
- [PULL 23/26] migration: Fix migration_channel_read_peek() error path, peterx, 2024/01/03
- [PULL 25/26] migration/multifd: Remove unnecessary usage of local Error, peterx, 2024/01/03
- [PULL 24/26] migration: Remove unnecessary usage of local Error,
peterx <=
- [PULL 26/26] migration: fix coverity migrate_mode finding, peterx, 2024/01/03
- Re: [PULL 00/26] Migration 20240104 patches, Peter Maydell, 2024/01/05
- Re: [PULL 00/26] Migration 20240104 patches, Peter Xu, 2024/01/07
- Re: [PULL 00/26] Migration 20240104 patches, Stefan Hajnoczi, 2024/01/07
- Re: [PULL 00/26] Migration 20240104 patches, Peter Maydell, 2024/01/07
- Re: [PULL 00/26] Migration 20240104 patches, Stefan Hajnoczi, 2024/01/07
- Re: [PULL 00/26] Migration 20240104 patches, Peter Xu, 2024/01/07
- Re: [PULL 00/26] Migration 20240104 patches, Peter Xu, 2024/01/07
- Re: [PULL 00/26] Migration 20240104 patches, Peter Maydell, 2024/01/08