[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/38] migration: Create migrate_rdma()
From: |
Juan Quintela |
Subject: |
[PULL 14/38] migration: Create migrate_rdma() |
Date: |
Mon, 16 Oct 2023 12:06:42 +0200 |
Helper to say if we are doing a migration over rdma.
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-2-quintela@redhat.com>
---
migration/migration.h | 2 ++
migration/options.h | 1 +
migration/migration.c | 1 +
migration/options.c | 7 +++++++
migration/rdma.c | 4 +++-
5 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/migration/migration.h b/migration/migration.h
index 974897a8d0..ae82004892 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -469,6 +469,8 @@ struct MigrationState {
* switchover has been received.
*/
bool switchover_acked;
+ /* Is this a rdma migration */
+ bool rdma_migration;
};
void migrate_set_state(int *state, int old_state, int new_state);
diff --git a/migration/options.h b/migration/options.h
index 93ee938ab8..237f2d6b4a 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -56,6 +56,7 @@ bool migrate_zero_copy_send(void);
bool migrate_multifd_flush_after_each_section(void);
bool migrate_postcopy(void);
+bool migrate_rdma(void);
bool migrate_tls(void);
/* capabilities helpers */
diff --git a/migration/migration.c b/migration/migration.c
index 79fa11e3f6..6ba5e145ac 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1452,6 +1452,7 @@ int migrate_init(MigrationState *s, Error **errp)
s->iteration_initial_bytes = 0;
s->threshold_size = 0;
s->switchover_acked = false;
+ s->rdma_migration = false;
/*
* set mig_stats compression_counters memory to zero for a
* new migration
diff --git a/migration/options.c b/migration/options.c
index 546cbe3106..42fb818956 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -378,6 +378,13 @@ bool migrate_postcopy(void)
return migrate_postcopy_ram() || migrate_dirty_bitmaps();
}
+bool migrate_rdma(void)
+{
+ MigrationState *s = migrate_get_current();
+
+ return s->rdma_migration;
+}
+
bool migrate_tls(void)
{
MigrationState *s = migrate_get_current();
diff --git a/migration/rdma.c b/migration/rdma.c
index f6fc226c9b..f155f3e1c8 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -4113,6 +4113,7 @@ static void rdma_accept_incoming_migration(void *opaque)
void rdma_start_incoming_migration(const char *host_port, Error **errp)
{
+ MigrationState *s = migrate_get_current();
int ret;
RDMAContext *rdma;
@@ -4144,7 +4145,7 @@ void rdma_start_incoming_migration(const char *host_port,
Error **errp)
}
trace_rdma_start_incoming_migration_after_rdma_listen();
-
+ s->rdma_migration = true;
qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migration,
NULL, (void *)(intptr_t)rdma);
return;
@@ -4220,6 +4221,7 @@ void rdma_start_outgoing_migration(void *opaque,
trace_rdma_start_outgoing_migration_after_rdma_connect();
s->to_dst_file = rdma_new_output(rdma);
+ s->rdma_migration = true;
migrate_fd_connect(s, NULL);
return;
return_path_err:
--
2.41.0
- [PULL 02/38] migration: Use g_autofree to simplify ram_dirty_bitmap_reload(), (continued)
- [PULL 02/38] migration: Use g_autofree to simplify ram_dirty_bitmap_reload(), Juan Quintela, 2023/10/16
- [PULL 04/38] migration: fix RAMBlock add NULL check, Juan Quintela, 2023/10/16
- [PULL 03/38] migration: Allow user to specify available switchover bandwidth, Juan Quintela, 2023/10/16
- [PULL 06/38] migration: Fix analyze-migration.py 'configuration' parsing, Juan Quintela, 2023/10/16
- [PULL 07/38] migration: Add capability parsing to analyze-migration.py, Juan Quintela, 2023/10/16
- [PULL 05/38] migration: Add the configuration vmstate to the json writer, Juan Quintela, 2023/10/16
- [PULL 09/38] migration: Fix analyze-migration read operation signedness, Juan Quintela, 2023/10/16
- [PULL 12/38] migration: hold the BQL during setup, Juan Quintela, 2023/10/16
- [PULL 08/38] migration: Fix analyze-migration.py when ignore-shared is used, Juan Quintela, 2023/10/16
- [PULL 10/38] tests/qtest/migration: Add a test for the analyze-migration script, Juan Quintela, 2023/10/16
- [PULL 14/38] migration: Create migrate_rdma(),
Juan Quintela <=
- [PULL 13/38] migration: Non multifd migration don't care about multifd flushes, Juan Quintela, 2023/10/16
- [PULL 15/38] migration/rdma: Unfold ram_control_before_iterate(), Juan Quintela, 2023/10/16
- [PULL 16/38] migration/rdma: Unfold ram_control_after_iterate(), Juan Quintela, 2023/10/16
- [PULL 11/38] tests/qtest: migration-test: Add tests for file-based migration, Juan Quintela, 2023/10/16
- Re: [PULL 11/38] tests/qtest: migration-test: Add tests for file-based migration, Fabiano Rosas, 2023/10/16
- Re: [PULL 11/38] tests/qtest: migration-test: Add tests for file-based migration, Juan Quintela, 2023/10/17
- Re: [PULL 11/38] tests/qtest: migration-test: Add tests for file-based migration, Fabiano Rosas, 2023/10/17
- Re: [PULL 11/38] tests/qtest: migration-test: Add tests for file-based migration, Juan Quintela, 2023/10/17
- Re: [PULL 11/38] tests/qtest: migration-test: Add tests for file-based migration, Fabiano Rosas, 2023/10/17
- Re: [PULL 11/38] tests/qtest: migration-test: Add tests for file-based migration, Juan Quintela, 2023/10/17