summaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@tencent.com>2018-05-03 16:06:11 +0800
committerJuan Quintela <quintela@redhat.com>2018-06-04 05:46:15 +0200
commitf548222c24342ca74689de7794f9006b43f86a54 (patch)
treee2828ca1ffae6910f2ddcfeac9a560f318e3903f /migration
parent392fba9f583223786f844dce9b2e7f9a0ce0147a (diff)
migration: introduce decompress-error-check
QEMU 3.0 enables strict check for compression & decompression to make the migration more robust, that depends on the source to fix the internal design which triggers the unexpected error conditions To make it work for migrating old version QEMU to 2.13 QEMU, we introduce this parameter to disable the error check on the destination which is the default behavior of the machine type which is older than 2.13, alternately, the strict check can be enabled explicitly as followings: -M pc-q35-2.11 -global migration.decompress-error-check=true Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c4
-rw-r--r--migration/migration.h7
-rw-r--r--migration/ram.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 05aec2c905..a5384865ff 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2971,6 +2971,8 @@ void migration_global_dump(Monitor *mon)
ms->send_configuration ? "on" : "off");
monitor_printf(mon, "send-section-footer: %s\n",
ms->send_section_footer ? "on" : "off");
+ monitor_printf(mon, "decompress-error-check: %s\n",
+ ms->decompress_error_check ? "on" : "off");
}
#define DEFINE_PROP_MIG_CAP(name, x) \
@@ -2984,6 +2986,8 @@ static Property migration_properties[] = {
send_configuration, true),
DEFINE_PROP_BOOL("send-section-footer", MigrationState,
send_section_footer, true),
+ DEFINE_PROP_BOOL("decompress-error-check", MigrationState,
+ decompress_error_check, true),
/* Migration parameters */
DEFINE_PROP_UINT8("x-compress-level", MigrationState,
diff --git a/migration/migration.h b/migration/migration.h
index 8f0c82159b..5af57d616c 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -212,6 +212,13 @@ struct MigrationState
/* Needed by postcopy-pause state */
QemuSemaphore postcopy_pause_sem;
QemuSemaphore postcopy_pause_rp_sem;
+ /*
+ * Whether we abort the migration if decompression errors are
+ * detected at the destination. It is left at false for qemu
+ * older than 3.0, since only newer qemu sends streams that
+ * do not trigger spurious decompression errors.
+ */
+ bool decompress_error_check;
};
void migrate_set_state(int *state, int old_state, int new_state);
diff --git a/migration/ram.c b/migration/ram.c
index c53e8369a3..090187ca04 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2881,7 +2881,7 @@ static void *do_data_decompress(void *opaque)
ret = qemu_uncompress_data(&param->stream, des, pagesize,
param->compbuf, len);
- if (ret < 0) {
+ if (ret < 0 && migrate_get_current()->decompress_error_check) {
error_report("decompress data failed");
qemu_file_set_error(decomp_file, ret);
}