qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 38/43] migration: Remove MigrationState from block_cleanup_parame


From: Juan Quintela
Subject: [PATCH 38/43] migration: Remove MigrationState from block_cleanup_parameters()
Date: Thu, 2 Mar 2023 17:34:05 +0100

This makes the function more regular with everything else.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/options.h   | 2 +-
 migration/migration.c | 4 ++--
 migration/options.c   | 4 +++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/migration/options.h b/migration/options.h
index bd1945d3d1..1d63c4069c 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -92,6 +92,6 @@ void migrate_set_block_incremental(bool value);
 
 bool migrate_params_check(MigrationParameters *params, Error **errp);
 void migrate_params_init(MigrationParameters *params);
-void block_cleanup_parameters(MigrationState *s);
+void block_cleanup_parameters(void);
 
 #endif
diff --git a/migration/migration.c b/migration/migration.c
index 5dc0bc86f1..71fc360240 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1216,7 +1216,7 @@ static void migrate_fd_cleanup(MigrationState *s)
         error_report_err(error_copy(s->error));
     }
     notifier_list_notify(&migration_state_notifiers, s);
-    block_cleanup_parameters(s);
+    block_cleanup_parameters();
     yank_unregister_instance(MIGRATION_YANK_INSTANCE);
 }
 
@@ -1710,7 +1710,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
                    "a valid migration protocol");
         migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,
                           MIGRATION_STATUS_FAILED);
-        block_cleanup_parameters(s);
+        block_cleanup_parameters();
         return;
     }
 
diff --git a/migration/options.c b/migration/options.c
index f7d46ccfc9..79187c3be0 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -601,8 +601,10 @@ void migrate_set_block_incremental(bool value)
 
 /* parameters helpers */
 
-void block_cleanup_parameters(MigrationState *s)
+void block_cleanup_parameters(void)
 {
+    MigrationState *s = migrate_get_current();
+
     if (s->must_remove_block_options) {
         /* setting to false can never fail */
         migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, false, &error_abort);
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]