[PATCH] migration: Minor control flow simplification

Eric Blake posted 1 patch 1 year ago
Failed in applying to current master (apply log)
migration/migration.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[PATCH] migration: Minor control flow simplification
Posted by Eric Blake 1 year ago
No need to declare a temporary variable.

Suggested-by: Juan Quintela <quintela@redhat.com>
Fixes: 1df36e8c6289 ("migration: Handle block device inactivation failures better")
Signed-off-by: Eric Blake <eblake@redhat.com>
---

If Juan's pull request
https://lists.gnu.org/archive/html/qemu-devel/2023-04/msg03138.html
needs a v2, then this can be squashed as a fixup to 15/20 of that
request; otherwise, this can go on top whenever convenient.

 migration/migration.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 7b0d4a9d8f2..59b6bcac958 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3432,7 +3432,6 @@ static void migration_completion(MigrationState *s)
         ret = global_state_store();

         if (!ret) {
-            bool inactivate = !migrate_colo_enabled();
             ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
             trace_migration_completion_vm_stop(ret);
             if (ret >= 0) {
@@ -3440,10 +3439,10 @@ static void migration_completion(MigrationState *s)
                                             MIGRATION_STATUS_DEVICE);
             }
             if (ret >= 0) {
-                s->block_inactive = inactivate;
+                s->block_inactive = !migrate_colo_enabled();
                 qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX);
                 ret = qemu_savevm_state_complete_precopy(s->to_dst_file, false,
-                                                         inactivate);
+                                                         s->block_inactive);
             }
         }
         qemu_mutex_unlock_iothread();

base-commit: cdf07846e6fe07a2e20c93eed5902114dc1d3dcf
-- 
2.40.0
Re: [PATCH] migration: Minor control flow simplification
Posted by Juan Quintela 1 year ago
Eric Blake <eblake@redhat.com> wrote:
> No need to declare a temporary variable.
>
> Suggested-by: Juan Quintela <quintela@redhat.com>
> Fixes: 1df36e8c6289 ("migration: Handle block device inactivation failures better")
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---

Reviewed-by: Juan Quintela <quintela@redhat.com>

Queued one way or another.