qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: Li Zhijian <lizhijian@fujitsu.com>,
	Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>,
	Fabiano Rosas <farosas@suse.de>,
	Leonardo Bras <leobras@redhat.com>
Subject: [PATCH v2 01/10] migration: Create migrate_rdma()
Date: Wed,  4 Oct 2023 14:49:04 +0200	[thread overview]
Message-ID: <20231004124913.16360-2-quintela@redhat.com> (raw)
In-Reply-To: <20231004124913.16360-1-quintela@redhat.com>

Helper to say if we are doing a migration over rdma.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <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 972597f4de..4543e36081 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -463,6 +463,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 045e2a41a2..a26fd1680b 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 585d3c8f55..1cb8898e6b 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1439,6 +1439,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 1d1e1321b0..0107d63b9b 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -376,6 +376,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 cd5e1afe60..6219227915 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -4126,6 +4126,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();
 
@@ -4156,7 +4157,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;
@@ -4233,6 +4234,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



  reply	other threads:[~2023-10-04 12:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 12:49 [PATCH v2 00/10] Removal of QEMUFileHooks Juan Quintela
2023-10-04 12:49 ` Juan Quintela [this message]
2023-10-04 12:49 ` [PATCH v2 02/10] migration/rdma: Unfold ram_control_before_iterate() Juan Quintela
2023-10-04 17:00   ` Fabiano Rosas
2023-10-04 12:49 ` [PATCH v2 03/10] migration/rdma: Unfold ram_control_after_iterate() Juan Quintela
2023-10-04 12:49 ` [PATCH v2 04/10] migration/rdma: Remove all uses of RAM_CONTROL_HOOK Juan Quintela
2023-10-04 12:49 ` [PATCH v2 05/10] migration/rdma: Unfold hook_ram_load() Juan Quintela
2023-10-04 12:49 ` [PATCH v2 06/10] migration/rdma: Create rdma_control_save_page() Juan Quintela
2023-10-04 12:49 ` [PATCH v2 07/10] qemu-file: Remove QEMUFileHooks Juan Quintela
2023-10-04 12:49 ` [PATCH v2 08/10] migration/rdma: Move rdma constants from qemu-file.h to rdma.h Juan Quintela
2023-10-04 12:49 ` [PATCH v2 09/10] migration/rdma: Remove qemu_ prefix from exported functions Juan Quintela
2023-10-04 12:49 ` [PATCH v2 10/10] migration/rdma: Check sooner if we are in postcopy for save_page() Juan Quintela
2023-10-04 17:11 ` [PATCH v2 00/10] Removal of QEMUFileHooks Peter Xu
2023-10-04 17:26   ` 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=20231004124913.16360-2-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=farosas@suse.de \
    --cc=leobras@redhat.com \
    --cc=lizhijian@fujitsu.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).