Commit f548222c authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Juan Quintela
Browse files

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: default avatarXiao Guangrong <xiaoguangrong@tencent.com>
Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
parent 392fba9f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1693,6 +1693,9 @@ static void machvirt_machine_init(void)
}
type_init(machvirt_machine_init);

#define VIRT_COMPAT_2_12 \
    HW_COMPAT_2_12

static void virt_2_12_instance_init(Object *obj)
{
    VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -1763,6 +1766,7 @@ static void virt_2_12_instance_init(Object *obj)

static void virt_machine_2_12_options(MachineClass *mc)
{
    SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_12);
}
DEFINE_VIRT_MACHINE_AS_LATEST(2, 12)

+1 −0
Original line number Diff line number Diff line
@@ -430,6 +430,7 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m)
    pc_i440fx_machine_options(m);
    m->alias = "pc";
    m->is_default = 1;
    SET_MACHINE_COMPAT(m, PC_COMPAT_2_12);
}

DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,
+1 −0
Original line number Diff line number Diff line
@@ -312,6 +312,7 @@ static void pc_q35_3_0_machine_options(MachineClass *m)
{
    pc_q35_machine_options(m);
    m->alias = "q35";
    SET_MACHINE_COMPAT(m, PC_COMPAT_2_12);
}

DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL,
+6 −1
Original line number Diff line number Diff line
#ifndef HW_COMPAT_H
#define HW_COMPAT_H

#define HW_COMPAT_2_12
#define HW_COMPAT_2_12 \
    {\
        .driver   = "migration",\
        .property = "decompress-error-check",\
        .value    = "off",\
    },

#define HW_COMPAT_2_11 \
    {\
+4 −0
Original line number Diff line number Diff line
@@ -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,
Loading