diff options
author | Wei Wang <wei.w.wang@intel.com> | 2023-06-06 18:19:09 +0800 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-07-26 10:55:56 +0200 |
commit | 82137e6c8c517e70fe93e262975eaaac5c911635 (patch) | |
tree | f57db47da37730bd3aa5434d5902c12bdf1f8e56 /migration/options.c | |
parent | 908927db28eafb404ec4c3a50249ddb52bd4afde (diff) | |
download | qemu-82137e6c8c517e70fe93e262975eaaac5c911635.zip qemu-82137e6c8c517e70fe93e262975eaaac5c911635.tar.gz qemu-82137e6c8c517e70fe93e262975eaaac5c911635.tar.bz2 |
migration: enforce multifd and postcopy preempt to be set before incoming
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>
Diffstat (limited to 'migration/options.c')
-rw-r--r-- | migration/options.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/migration/options.c b/migration/options.c index 7d83f19..1d1e132 100644 --- a/migration/options.c +++ b/migration/options.c @@ -441,6 +441,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 * @@ -564,6 +569,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]) { @@ -571,6 +582,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_SWITCHOVER_ACK]) { |