[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/30] migration: enforce multifd and postcopy preempt to be set b
From: |
Juan Quintela |
Subject: |
[PULL 22/30] migration: enforce multifd and postcopy preempt to be set before incoming |
Date: |
Thu, 22 Jun 2023 18:55:19 +0200 |
From: Wei Wang <wei.w.wang@intel.com>
qemu_start_incoming_migration needs to check the number of multifd
channels or postcopy ram channels to configure the backlog parameter (i.e.
the maximum length to which the queue of pending connections for sockfd
may grow) of listen(). So enforce the usage of postcopy-preempt and
multifd as below:
- need to use "-incoming defer" on the destination; and
- set_capability and set_parameter need to be done before migrate_incoming
Otherwise, disable the use of the features and report error messages to
remind users to adjust the commands.
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230606101910.20456-2-wei.w.wang@intel.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
---
migration/options.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/migration/options.c b/migration/options.c
index ba1010e08b..c072c2fab7 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -433,6 +433,11 @@ INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snapshot,
MIGRATION_CAPABILITY_VALIDATE_UUID,
MIGRATION_CAPABILITY_ZERO_COPY_SEND);
+static bool migrate_incoming_started(void)
+{
+ return !!migration_incoming_get_current()->transport_data;
+}
+
/**
* @migration_caps_check - check capability compatibility
*
@@ -556,6 +561,12 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps,
Error **errp)
error_setg(errp, "Postcopy preempt not compatible with compress");
return false;
}
+
+ if (migrate_incoming_started()) {
+ error_setg(errp,
+ "Postcopy preempt must be set before incoming starts");
+ return false;
+ }
}
if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) {
@@ -563,6 +574,10 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps,
Error **errp)
error_setg(errp, "Multifd is not compatible with compress");
return false;
}
+ if (migrate_incoming_started()) {
+ error_setg(errp, "Multifd must be set before incoming starts");
+ return false;
+ }
}
if (new_caps[MIGRATION_CAPABILITY_DIRTY_LIMIT]) {
--
2.40.1
- [PULL 15/30] migration-test: Create kvm_opts, (continued)
- [PULL 15/30] migration-test: Create kvm_opts, Juan Quintela, 2023/06/22
- [PULL 17/30] migration-test: Add bootfile_create/delete() functions, Juan Quintela, 2023/06/22
- [PULL 21/30] migration: Refactor repeated call of yank_unregister_instance, Juan Quintela, 2023/06/22
- [PULL 14/30] migration-test: machine_opts is really arch specific, Juan Quintela, 2023/06/22
- [PULL 13/30] migration-test: Create arch_opts, Juan Quintela, 2023/06/22
- [PULL 10/30] migration: Extend query-migrate to provide dirty page limit info, Juan Quintela, 2023/06/22
- [PULL 18/30] migration-test: dirtylimit checks for x86_64 arch before, Juan Quintela, 2023/06/22
- [PULL 19/30] migration-test: simplify shmem_opts handling, Juan Quintela, 2023/06/22
- [PULL 23/30] qtest/migration-tests.c: use "-incoming defer" for postcopy tests, Juan Quintela, 2023/06/22
- [PULL 20/30] migration: Update error description whenever migration fails, Juan Quintela, 2023/06/22
- [PULL 22/30] migration: enforce multifd and postcopy preempt to be set before incoming,
Juan Quintela <=
- [PULL 28/30] qemu-file: Simplify qemu_file_shutdown(), Juan Quintela, 2023/06/22
- [PULL 26/30] migration: Use qemu_file_transferred_noflush() for block migration., Juan Quintela, 2023/06/22
- [PULL 25/30] migration: Change qemu_file_transferred to noflush, Juan Quintela, 2023/06/22
- [PULL 29/30] qemu-file: Make qemu_file_get_error_obj() static, Juan Quintela, 2023/06/22
- [PULL 30/30] migration/rdma: Split qemu_fopen_rdma() into input/output functions, Juan Quintela, 2023/06/22
- [PULL 24/30] qemu-file: Rename qemu_file_transferred_ fast -> noflush, Juan Quintela, 2023/06/22
- [PULL 27/30] qemu_file: Make qemu_file_is_writable() static, Juan Quintela, 2023/06/22
- Re: [PULL 00/30] Next patches, Richard Henderson, 2023/06/23