[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/41] migration: Be sure all recv channels are creat
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 08/41] migration: Be sure all recv channels are created |
Date: |
Wed, 9 May 2018 13:23:33 +0200 |
We need them before we start migration.
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
---
migration/migration.c | 6 +++++-
migration/ram.c | 11 +++++++++++
migration/ram.h | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/migration/migration.c b/migration/migration.c
index 4a7959c111..8e5b421b97 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -462,7 +462,11 @@ void migration_ioc_process_incoming(QIOChannel *ioc)
*/
bool migration_has_all_channels(void)
{
- return true;
+ bool all_channels;
+
+ all_channels = multifd_recv_all_channels_created();
+
+ return all_channels;
}
/*
diff --git a/migration/ram.c b/migration/ram.c
index 1aa661e6ab..d5335c10b6 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -671,6 +671,17 @@ int multifd_load_setup(void)
return 0;
}
+bool multifd_recv_all_channels_created(void)
+{
+ int thread_count = migrate_multifd_channels();
+
+ if (!migrate_use_multifd()) {
+ return true;
+ }
+
+ return thread_count == atomic_read(&multifd_recv_state->count);
+}
+
void multifd_recv_new_channel(QIOChannel *ioc)
{
/* nothing to do yet */
diff --git a/migration/ram.h b/migration/ram.h
index 06dbddc2a2..3f4b7daee8 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -45,6 +45,7 @@ int multifd_save_setup(void);
int multifd_save_cleanup(Error **errp);
int multifd_load_setup(void);
int multifd_load_cleanup(Error **errp);
+bool multifd_recv_all_channels_created(void);
void multifd_recv_new_channel(QIOChannel *ioc);
uint64_t ram_pagesize_summary(void);
--
2.17.0
- [Qemu-devel] [PULL 00/41] Migration queue, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 01/41] migration: fix saving normal page even if it's been compressed, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 02/41] tests: Add migration precopy test, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 03/41] tests: Add migration xbzrle test, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 04/41] tests: Migration ppc now inlines its program, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 06/41] migration: Introduce multifd_recv_new_channel(), Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 05/41] migration: Set error state in case of error, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 07/41] migration: terminate_* can be called for other threads, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 08/41] migration: Be sure all recv channels are created,
Juan Quintela <=
- [Qemu-devel] [PULL 09/41] migration: Export functions to create send channels, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 10/41] migration: Create multifd channels, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 11/41] migration: Delay start of migration main routines, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 12/41] migration: Transmit initial package through the multifd channels, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 13/41] migration: Define MultifdRecvParams sooner, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 15/41] migration: new postcopy-pause state, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 16/41] migration: implement "postcopy-pause" src logic, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 17/41] migration: allow dst vm pause on postcopy, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 18/41] migration: allow src return path to pause, Juan Quintela, 2018/05/09
- [Qemu-devel] [PULL 14/41] migration: let incoming side use thread context, Juan Quintela, 2018/05/09