qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,
	Leonardo Bras <leobras@redhat.com>
Subject: Re: [PATCH v2 01/16] migration: Create migrate_rdma()
Date: Wed, 3 May 2023 14:34:11 +0100	[thread overview]
Message-ID: <ZFJi0/K2BXhYkh75@redhat.com> (raw)
In-Reply-To: <20230503131847.11603-2-quintela@redhat.com>

On Wed, May 03, 2023 at 03:18:32PM +0200, Juan Quintela wrote:
> Helper to say if we are doing a migration over rdma.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration/migration.h | 3 +++
>  migration/options.c   | 7 +++++++
>  migration/options.h   | 1 +
>  migration/rdma.c      | 4 +++-
>  4 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/migration/migration.h b/migration/migration.h
> index 3a918514e7..47fe116167 100644
> --- a/migration/migration.h
> +++ b/migration/migration.h
> @@ -432,6 +432,9 @@ struct MigrationState {
>  
>      /* QEMU_VM_VMDESCRIPTION content filled for all non-iterable devices. */
>      JSONWriter *vmdesc;
> +
> +    /* 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.c b/migration/options.c
> index 53b7fc5d5d..39843f9325 100644
> --- a/migration/options.c
> +++ b/migration/options.c
> @@ -349,6 +349,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/options.h b/migration/options.h
> index 3c322867cd..3c555e28c7 100644
> --- a/migration/options.h
> +++ b/migration/options.h
> @@ -61,6 +61,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/rdma.c b/migration/rdma.c
> index 7e747b2595..b026e98519 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -4119,6 +4119,7 @@ void rdma_start_incoming_migration(const char *host_port, Error **errp)
>      int ret;
>      RDMAContext *rdma;
>      Error *local_err = NULL;
> +    MigrationState *s = migrate_get_current();
>  
>      trace_rdma_start_incoming_migration();
>  
> @@ -4149,7 +4150,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;
> @@ -4225,6 +4226,7 @@ void rdma_start_outgoing_migration(void *opaque,
>  
>      trace_rdma_start_outgoing_migration_after_rdma_connect();
>  
> +    s->rdma_migration = true;
>      s->to_dst_file = qemu_fopen_rdma(rdma, "wb");
>      migrate_fd_connect(s, NULL);
>      return;

Is the "MigrationState" allocated freshly for every incoming
or outgoing migration ?  If it is reused, then something
needs to set 's->rdma_migration = false' in non-RDMA code
paths.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2023-05-03 13:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 13:18 [PATCH v2 00/16] migration: Remove QEMUFileHooks Juan Quintela
2023-05-03 13:18 ` [PATCH v2 01/16] migration: Create migrate_rdma() Juan Quintela
2023-05-03 13:34   ` Daniel P. Berrangé [this message]
2023-05-03 14:01     ` Juan Quintela
2023-05-03 13:18 ` [PATCH v2 02/16] migration/rdma: Unfold ram_control_before_iterate() Juan Quintela
2023-05-03 13:18 ` [PATCH v2 03/16] migration/rdma: Unfold ram_control_after_iterate() Juan Quintela
2023-05-03 13:18 ` [PATCH v2 04/16] migration/rdma: simplify ram_control_load_hook() Juan Quintela
2023-05-03 13:18 ` [PATCH v2 05/16] migration/rdma: Don't pass the QIOChannelRDMA as an opaque Juan Quintela
2023-05-03 13:35   ` Daniel P. Berrangé
2023-05-03 13:18 ` [PATCH v2 06/16] migration/rdma: We can calculate the rioc from the QEMUFile Juan Quintela
2023-05-03 13:18 ` [PATCH v2 07/16] migration/rdma: It makes no sense to recive that flag without RDMA Juan Quintela
2023-05-03 13:18 ` [PATCH v2 08/16] migration: Make RAM_SAVE_FLAG_HOOK a normal case entry Juan Quintela
2023-05-03 13:18 ` [PATCH v2 09/16] migration/rdma: Remove all uses of RAM_CONTROL_HOOK Juan Quintela
2023-05-03 13:18 ` [PATCH v2 10/16] migration/rdma: Unfold hook_ram_load() Juan Quintela
2023-05-03 13:18 ` [PATCH v2 11/16] migration/rdma: Make ram_control_save_page() use exported interfaces Juan Quintela
2023-05-03 13:18 ` [PATCH v2 12/16] migration/rdma: Create rdma_control_save_page() Juan Quintela
2023-05-03 13:18 ` [PATCH v2 13/16] qemu-file: Remove QEMUFileHooks Juan Quintela
2023-05-03 13:18 ` [PATCH v2 14/16] migration/rdma: Move rdma constants from qemu-file.h to rdma.h Juan Quintela
2023-05-03 13:18 ` [PATCH v2 15/16] migration/rdma: Remove qemu_ prefix from exported functions Juan Quintela
2023-05-03 13:18 ` [PATCH v2 16/16] migration/rdma: If we are in postcopy don't do anything Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZFJi0/K2BXhYkh75@redhat.com \
    --to=berrange@redhat.com \
    --cc=leobras@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).