@@ -53,6 +53,14 @@
#define MAX_MIGRATE_DOWNTIME_SECONDS 2000
#define MAX_MIGRATE_DOWNTIME (MAX_MIGRATE_DOWNTIME_SECONDS * 1000)
+/* Parameters for self_announce_delay giving a stream of RARP/ARP
+ * packets after migration.
+ */
+#define DEFAULT_MIGRATE_ANNOUNCE_INITIAL 50
+#define DEFAULT_MIGRATE_ANNOUNCE_MAX 550
+#define DEFAULT_MIGRATE_ANNOUNCE_ROUNDS 5
+#define DEFAULT_MIGRATE_ANNOUNCE_STEP 100
+
/* Default compression thread count */
#define DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT 8
/* Default decompression thread count, usually decompression is at
@@ -97,6 +105,10 @@ MigrationState *migrate_get_current(void)
.xbzrle_cache_size = DEFAULT_MIGRATE_CACHE_SIZE,
.mbps = -1,
.parameters = {
+ .announce_initial = DEFAULT_MIGRATE_ANNOUNCE_INITIAL,
+ .announce_max = DEFAULT_MIGRATE_ANNOUNCE_MAX,
+ .announce_rounds = DEFAULT_MIGRATE_ANNOUNCE_ROUNDS,
+ .announce_step = DEFAULT_MIGRATE_ANNOUNCE_STEP,
.compress_level = DEFAULT_MIGRATE_COMPRESS_LEVEL,
.compress_threads = DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT,
.decompress_threads = DEFAULT_MIGRATE_DECOMPRESS_THREAD_COUNT,
@@ -580,6 +592,14 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
MigrationState *s = migrate_get_current();
params = g_malloc0(sizeof(*params));
+ params->has_announce_initial = true;
+ params->announce_initial = s->parameters.announce_initial;
+ params->has_announce_max = true;
+ params->announce_max = s->parameters.announce_max;
+ params->has_announce_rounds = true;
+ params->announce_rounds = s->parameters.announce_rounds;
+ params->has_announce_step = true;
+ params->announce_step = s->parameters.announce_step;
params->has_compress_level = true;
params->compress_level = s->parameters.compress_level;
params->has_compress_threads = true;
@@ -809,6 +829,26 @@ void qmp_migrate_set_parameters(MigrationParameters *params, Error **errp)
{
MigrationState *s = migrate_get_current();
+ if (params->has_announce_initial &&
+ (params->announce_initial < 1 || params->announce_initial > 100000)) {
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "announce_initial",
+ "is invalid, it should be in the range of 1 to 100000 ms");
+ }
+ if (params->has_announce_max &&
+ (params->announce_max < 1 || params->announce_max > 100000)) {
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "announce_max",
+ "is invalid, it should be in the range of 1 to 100000 ms");
+ }
+ if (params->has_announce_rounds &&
+ (params->announce_rounds < 1 || params->announce_rounds > 1000)) {
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "announce_rounds",
+ "is invalid, it should be in the range of 1 to 1000");
+ }
+ if (params->has_announce_step &&
+ (params->announce_step < 0 || params->announce_step > 10000)) {
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "announce_step",
+ "is invalid, it should be in the range of 1 to 10000 ms");
+ }
if (params->has_compress_level &&
(params->compress_level < 0 || params->compress_level > 9)) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level",
@@ -865,6 +905,18 @@ void qmp_migrate_set_parameters(MigrationParameters *params, Error **errp)
"is invalid, it should be positive");
}
+ if (params->has_announce_initial) {
+ s->parameters.announce_initial = params->announce_initial;
+ }
+ if (params->has_announce_max) {
+ s->parameters.announce_max = params->announce_max;
+ }
+ if (params->has_announce_rounds) {
+ s->parameters.announce_rounds = params->announce_rounds;
+ }
+ if (params->has_announce_step) {
+ s->parameters.announce_step = params->announce_step;
+ }
if (params->has_compress_level) {
s->parameters.compress_level = params->compress_level;
}
@@ -960,6 +960,18 @@
#
# Migration parameters enumeration
#
+# @announce-initial: The inital delay (in ms) before sending the first announce
+# (Since 2.10)
+#
+# @announce-max: The maximum delay (in ms) between packets in the announcment
+# (Since 2.10)
+#
+# @announce-rounds: The number of self-announce packets sent after migration
+# (Since 2.10)
+#
+# @announce-step: The increase in delay (in ms) between subsequent packets in
+# the announcement (Since 2.10)
+#
# @compress-level: Set the compression level to be used in live migration,
# the compression level is an integer between 0 and 9, where 0 means
# no compression, 1 means the best compression speed, and 9 means best
@@ -1009,7 +1021,9 @@
# Since: 2.4
##
{ 'enum': 'MigrationParameter',
- 'data': ['compress-level', 'compress-threads', 'decompress-threads',
+ 'data': ['announce-initial', 'announce-max',
+ 'announce-rounds', 'announce-step',
+ 'compress-level', 'compress-threads', 'decompress-threads',
'cpu-throttle-initial', 'cpu-throttle-increment',
'tls-creds', 'tls-hostname', 'max-bandwidth',
'downtime-limit', 'x-checkpoint-delay' ] }
@@ -1038,6 +1052,18 @@
# ('query-migrate-parameters'), with the exception of tls-creds and
# tls-hostname.
#
+# @announce-initial: The inital delay (in ms) before sending the first announce
+# (Since 2.10)
+#
+# @announce-max: The maximum delay (in ms) between packets in the announcment
+# (Since 2.10)
+#
+# @announce-rounds: The number of self-announce packets sent after migration
+# (Since 2.10)
+#
+# @announce-step: The increase in delay (in ms) between subsequent packets in
+# the announcement (Since 2.10)
+#
# @compress-level: compression level
#
# @compress-threads: compression thread count
@@ -1082,7 +1108,11 @@
# Since: 2.4
##
{ 'struct': 'MigrationParameters',
- 'data': { '*compress-level': 'int',
+ 'data': { '*announce-initial': 'int',
+ '*announce-max': 'int',
+ '*announce-rounds': 'int',
+ '*announce-step': 'int',
+ '*compress-level': 'int',
'*compress-threads': 'int',
'*decompress-threads': 'int',
'*cpu-throttle-initial': 'int',