[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/17] migration: Store MigrationAddress in MigrationState
From: |
Avihai Horon |
Subject: |
[PATCH 13/17] migration: Store MigrationAddress in MigrationState |
Date: |
Thu, 25 Jan 2024 18:25:24 +0200 |
This will be used in the new migration channel creation API in the
following patches.
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
---
migration/migration.h | 3 +++
migration/migration.c | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/migration/migration.h b/migration/migration.h
index 17972dac34..dc370ab3e8 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -470,6 +470,9 @@ struct MigrationState {
bool switchover_acked;
/* Is this a rdma migration */
bool rdma_migration;
+
+ /* The address used for this migration */
+ MigrationAddress *address;
};
void migrate_set_state(int *state, int old_state, int new_state);
diff --git a/migration/migration.c b/migration/migration.c
index d81d96eaa5..deaa79ff14 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1286,6 +1286,8 @@ static void migrate_fd_cleanup(MigrationState *s)
s->hostname = NULL;
json_writer_free(s->vmdesc);
s->vmdesc = NULL;
+ qapi_free_MigrationAddress(s->address);
+ s->address = NULL;
qemu_savevm_state_cleanup();
@@ -1974,6 +1976,8 @@ void qmp_migrate(const char *uri, bool has_channels,
}
}
+ s->address = QAPI_CLONE(MigrationAddress, addr);
+
if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) {
SocketAddress *saddr = &addr->u.socket;
if (saddr->type == SOCKET_ADDRESS_TYPE_INET ||
@@ -2005,6 +2009,8 @@ void qmp_migrate(const char *uri, bool has_channels,
}
migrate_fd_error(s, local_err);
error_propagate(errp, local_err);
+ qapi_free_MigrationAddress(s->address);
+ s->address = NULL;
return;
}
}
--
2.26.3
- Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place, (continued)
- [PATCH 06/17] migration/tls: Rename main migration channel TLS functions, Avihai Horon, 2024/01/25
- [PATCH 07/17] migration/tls: Add new migration channel TLS upgrade API, Avihai Horon, 2024/01/25
- [PATCH 09/17] migration/multifd: Use the new TLS upgrade API for multifd channels, Avihai Horon, 2024/01/25
- [PATCH 08/17] migration: Use the new TLS upgrade API for main channel, Avihai Horon, 2024/01/25
- [PATCH 14/17] migration: Rename migration_channel_connect(), Avihai Horon, 2024/01/25
- [PATCH 13/17] migration: Store MigrationAddress in MigrationState,
Avihai Horon <=
- [PATCH 16/17] migration/multifd: Use the new migration channel connect API for multifd, Avihai Horon, 2024/01/25
- [PATCH 17/17] migration/postcopy: Use the new migration channel connect API for postcopy preempt, Avihai Horon, 2024/01/25
- [PATCH 15/17] migration: Add new migration channel connect API, Avihai Horon, 2024/01/25