[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/5] migration: Established connection for listener sockets o
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 5/5] migration: Established connection for listener sockets on the dest interface |
Date: |
Thu, 12 Jan 2023 07:38:06 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Het Gala <het.gala@nutanix.com> writes:
> From: Author Het Gala <het.gala@nutanix.com>
>
> Modified 'migrate-incoming' QAPI supports MigrateChannel parameters to prevent
> multi-level encodings of uri on the destination side.
>
> socket_start_incoming_migration() has been depricated as it's only purpose was
> uri parsing.
> Renamed socket_outgoing_migration_internal() as
> socket_start_incoming_migration().
> qemu_uri_parsing() is used to populate the new struct from 'uri' string
> needed for migration connection. The function will no longer be used once the
> 'uri' parameter is depricated, as the parameters will already be mapped into
> new struct.
>
> Suggested-by: Daniel P. Berrange <berrange@redhat.com>
> Suggested-by: Manish Mishra <manish.mishra@nutanix.com>
> Suggested-by: Aravind Retnakaran <aravind.retnakaran@nutanix.com>
> Signed-off-by: Het Gala <het.gala@nutanix.com>
> ---
> migration/migration.c | 48 ++++++++++++++++++++++++++++---------------
> migration/socket.c | 16 ++-------------
> migration/socket.h | 2 +-
> 3 files changed, 35 insertions(+), 31 deletions(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index 838940fd55..c70fd0ab4f 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -520,27 +520,43 @@ static void qemu_uri_parsing(const char *uri,
> }
> }
>
> -static void qemu_start_incoming_migration(const char *uri, Error **errp)
> +static void qemu_start_incoming_migration(const char *uri,
> + MigrateChannel *channel,
> + Error **errp)
> {
> - const char *p = NULL;
> + MigrateAddress *addrs = g_new0(MigrateAddress, 1);
> + SocketAddress *saddr = g_new0(SocketAddress, 1);
> +
> + /*
> + * motive here is just to have checks and convert uri into
> + * socketaddress struct
> + */
> + if (uri && channel) {
> + error_setg(errp, "uri and channels options should be used "
> + "mutually exclusive");
> + } else if (uri) {
> + qemu_uri_parsing(uri, &channel, errp);
> + }
>
> migrate_protocol_allow_multi_channels(false); /* reset it anyway */
> qapi_event_send_migration(MIGRATION_STATUS_SETUP);
> - if (strstart(uri, "tcp:", &p) ||
> - strstart(uri, "unix:", NULL) ||
> - strstart(uri, "vsock:", NULL)) {
> - migrate_protocol_allow_multi_channels(true);
> - socket_start_incoming_migration(p ? p : uri, errp);
> + if (addrs->transport == MIGRATE_TRANSPORT_SOCKET) {
> + if (saddr->type == SOCKET_ADDRESS_TYPE_INET ||
> + saddr->type == SOCKET_ADDRESS_TYPE_UNIX ||
> + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) {
> + migrate_protocol_allow_multi_channels(true);
> + socket_start_incoming_migration(saddr, errp);
> + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) {
> + fd_start_incoming_migration(saddr->u.fd.str, errp);
> + }
> #ifdef CONFIG_RDMA
> - } else if (strstart(uri, "rdma:", &p)) {
> - rdma_start_incoming_migration(p, errp);
> + } else if (addrs->transport == MIGRATE_TRANSPORT_RDMA) {
> + rdma_start_incomng_migration(addrs->u.rdma.rdma_str, errp);
Fails to compile:
../migration/migration.c: In function ‘qemu_start_incoming_migration’:
../migration/migration.c:554:9: error: implicit declaration of function
‘rdma_start_incomng_migration’; did you mean ‘rdma_start_incoming_migration’?
[-Werror=implicit-function-declaration]
554 | rdma_start_incomng_migration(addrs->u.rdma.rdma_str, errp);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| rdma_start_incoming_migration
../migration/migration.c:554:9: error: nested extern declaration of
‘rdma_start_incomng_migration’ [-Werror=nested-externs]
Please fix that, and also test RDMA.
> #endif
> - } else if (strstart(uri, "exec:", &p)) {
> - exec_start_incoming_migration(p, errp);
> - } else if (strstart(uri, "fd:", &p)) {
> - fd_start_incoming_migration(p, errp);
> + } else if (addrs->transport == MIGRATE_TRANSPORT_EXEC) {
> + exec_start_incoming_migration(addrs->u.exec.exec_str, errp);
> } else {
> - error_setg(errp, "unknown migration protocol: %s", uri);
> + error_setg(errp, "unknown migration protocol: %i", addrs->transport);
> }
> }
>
[...]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 5/5] migration: Established connection for listener sockets on the dest interface,
Markus Armbruster <=