* [Qemu-devel] [PATCH] migration/multifd: multifd_load_cleanup() always return 0
@ 2019-07-22 6:24 Wei Yang
2019-07-23 15:39 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 3+ messages in thread
From: Wei Yang @ 2019-07-22 6:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Wei Yang, dgilbert, quintela
multifd_load_cleanup() always return 0 and never use the errp, just
cleanup a little.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
migration/migration.c | 9 ++-------
migration/ram.c | 7 +++----
migration/ram.h | 2 +-
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 27ca10122f..38d2fdfa73 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -399,10 +399,7 @@ static void process_incoming_migration_bh(void *opaque)
*/
qemu_announce_self(&mis->announce_timer, migrate_announce_params());
- if (multifd_load_cleanup(&local_err) != 0) {
- error_report_err(local_err);
- autostart = false;
- }
+ multifd_load_cleanup();
/* If global state section was not received or we are in running
state, we need to obey autostart. Any other state is set with
runstate_set. */
@@ -506,9 +503,7 @@ fail:
migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
MIGRATION_STATUS_FAILED);
qemu_fclose(mis->from_src_file);
- if (multifd_load_cleanup(&local_err) != 0) {
- error_report_err(local_err);
- }
+ multifd_load_cleanup();
exit(EXIT_FAILURE);
}
diff --git a/migration/ram.c b/migration/ram.c
index 66792568e2..7d30f8484c 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1243,13 +1243,12 @@ static void multifd_recv_terminate_threads(Error *err)
}
}
-int multifd_load_cleanup(Error **errp)
+void multifd_load_cleanup(void)
{
int i;
- int ret = 0;
if (!migrate_use_multifd()) {
- return 0;
+ return;
}
multifd_recv_terminate_threads(NULL);
for (i = 0; i < migrate_multifd_channels(); i++) {
@@ -1276,7 +1275,7 @@ int multifd_load_cleanup(Error **errp)
g_free(multifd_recv_state);
multifd_recv_state = NULL;
- return ret;
+ return;
}
static void multifd_recv_sync_main(void)
diff --git a/migration/ram.h b/migration/ram.h
index e0a499b956..6fdd449899 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -44,7 +44,7 @@ uint64_t ram_bytes_total(void);
int multifd_save_setup(void);
void multifd_save_cleanup(void);
int multifd_load_setup(void);
-int multifd_load_cleanup(Error **errp);
+void multifd_load_cleanup(void);
bool multifd_recv_all_channels_created(void);
bool multifd_recv_new_channel(QIOChannel *ioc, Error **errp);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] migration/multifd: multifd_load_cleanup() always return 0
2019-07-22 6:24 [Qemu-devel] [PATCH] migration/multifd: multifd_load_cleanup() always return 0 Wei Yang
@ 2019-07-23 15:39 ` Dr. David Alan Gilbert
2019-07-24 1:12 ` Wei Yang
0 siblings, 1 reply; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2019-07-23 15:39 UTC (permalink / raw)
To: Wei Yang; +Cc: qemu-devel, quintela
* Wei Yang (richardw.yang@linux.intel.com) wrote:
> multifd_load_cleanup() always return 0 and never use the errp, just
> cleanup a little.
>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
I'd rather leave this; it wouldn't be that odd for us to add an error
check there later.
Dave
> ---
> migration/migration.c | 9 ++-------
> migration/ram.c | 7 +++----
> migration/ram.h | 2 +-
> 3 files changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index 27ca10122f..38d2fdfa73 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -399,10 +399,7 @@ static void process_incoming_migration_bh(void *opaque)
> */
> qemu_announce_self(&mis->announce_timer, migrate_announce_params());
>
> - if (multifd_load_cleanup(&local_err) != 0) {
> - error_report_err(local_err);
> - autostart = false;
> - }
> + multifd_load_cleanup();
> /* If global state section was not received or we are in running
> state, we need to obey autostart. Any other state is set with
> runstate_set. */
> @@ -506,9 +503,7 @@ fail:
> migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
> MIGRATION_STATUS_FAILED);
> qemu_fclose(mis->from_src_file);
> - if (multifd_load_cleanup(&local_err) != 0) {
> - error_report_err(local_err);
> - }
> + multifd_load_cleanup();
> exit(EXIT_FAILURE);
> }
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 66792568e2..7d30f8484c 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1243,13 +1243,12 @@ static void multifd_recv_terminate_threads(Error *err)
> }
> }
>
> -int multifd_load_cleanup(Error **errp)
> +void multifd_load_cleanup(void)
> {
> int i;
> - int ret = 0;
>
> if (!migrate_use_multifd()) {
> - return 0;
> + return;
> }
> multifd_recv_terminate_threads(NULL);
> for (i = 0; i < migrate_multifd_channels(); i++) {
> @@ -1276,7 +1275,7 @@ int multifd_load_cleanup(Error **errp)
> g_free(multifd_recv_state);
> multifd_recv_state = NULL;
>
> - return ret;
> + return;
> }
>
> static void multifd_recv_sync_main(void)
> diff --git a/migration/ram.h b/migration/ram.h
> index e0a499b956..6fdd449899 100644
> --- a/migration/ram.h
> +++ b/migration/ram.h
> @@ -44,7 +44,7 @@ uint64_t ram_bytes_total(void);
> int multifd_save_setup(void);
> void multifd_save_cleanup(void);
> int multifd_load_setup(void);
> -int multifd_load_cleanup(Error **errp);
> +void multifd_load_cleanup(void);
> bool multifd_recv_all_channels_created(void);
> bool multifd_recv_new_channel(QIOChannel *ioc, Error **errp);
>
> --
> 2.17.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] migration/multifd: multifd_load_cleanup() always return 0
2019-07-23 15:39 ` Dr. David Alan Gilbert
@ 2019-07-24 1:12 ` Wei Yang
0 siblings, 0 replies; 3+ messages in thread
From: Wei Yang @ 2019-07-24 1:12 UTC (permalink / raw)
To: Dr. David Alan Gilbert; +Cc: quintela, Wei Yang, qemu-devel
On Tue, Jul 23, 2019 at 04:39:08PM +0100, Dr. David Alan Gilbert wrote:
>* Wei Yang (richardw.yang@linux.intel.com) wrote:
>> multifd_load_cleanup() always return 0 and never use the errp, just
>> cleanup a little.
>>
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>
>I'd rather leave this; it wouldn't be that odd for us to add an error
>check there later.
>
Sounds reasonable :-)
>Dave
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-24 1:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 6:24 [Qemu-devel] [PATCH] migration/multifd: multifd_load_cleanup() always return 0 Wei Yang
2019-07-23 15:39 ` Dr. David Alan Gilbert
2019-07-24 1:12 ` Wei Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).