@@ -322,7 +322,6 @@ static void x86_cpu_change_kvm_default(const char *prop,
static void pc_compat_2_3(MachineState *machine)
{
PCMachineState *pcms = PC_MACHINE(machine);
- savevm_skip_section_footers();
if (kvm_enabled()) {
pcms->smm = ON_OFF_AUTO_OFF;
}
@@ -3579,7 +3579,6 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false);
static void spapr_machine_2_3_instance_options(MachineState *machine)
{
spapr_machine_2_4_instance_options(machine);
- savevm_skip_section_footers();
}
static void spapr_machine_2_3_class_options(MachineClass *mc)
@@ -144,7 +144,7 @@ static int xen_init(MachineState *ms)
accel_register_prop(accel, "migration", "store-global-state", "off");
accel_register_prop(accel, "migration", "send-configuration", "off");
- savevm_skip_section_footers();
+ accel_register_prop(accel, "migration", "send-section-footer", "off");
return 0;
}
@@ -187,6 +187,10 @@
.value = "off",\
},{\
.driver = "migration",\
+ .property = "send-section-footer",\
+ .value = "off",\
+ },{\
+ .driver = "migration",\
.property = "store-global-state",\
.value = "off",\
},
@@ -41,7 +41,6 @@ int64_t self_announce_delay(int round)
/* migration/savevm.c */
void dump_vmstate_json_to_file(FILE *out_fp);
-void savevm_skip_section_footers(void);
/* migration/migration.c */
void qemu_start_incoming_migration(const char *uri, Error **errp);
@@ -1987,6 +1987,8 @@ static Property migration_properties[] = {
DEFINE_PROP_BOOL("only-migratable", MigrationState, only_migratable, false),
DEFINE_PROP_BOOL("send-configuration", MigrationState,
send_configuration, true),
+ DEFINE_PROP_BOOL("send-section-footer", MigrationState,
+ send_section_footer, true),
DEFINE_PROP_END_OF_LIST(),
};
@@ -145,6 +145,8 @@ struct MigrationState
/* Whether we send QEMU_VM_CONFIGURATION during migration */
bool send_configuration;
+ /* Whether we send section footer during migration */
+ bool send_section_footer;
};
void migrate_set_state(int *state, int old_state, int new_state);
@@ -62,8 +62,6 @@
const unsigned int postcopy_ram_discard_version = 0;
-static bool skip_section_footers;
-
/* Subcommands for QEMU_VM_COMMAND */
enum qemu_vm_cmd {
MIG_CMD_INVALID = 0, /* Must be 0 */
@@ -761,11 +759,6 @@ static void vmstate_save(QEMUFile *f, SaveStateEntry *se, QJSON *vmdesc)
vmstate_save_state(f, se->vmsd, se->opaque, vmdesc);
}
-void savevm_skip_section_footers(void)
-{
- skip_section_footers = true;
-}
-
/*
* Write the header for device section (QEMU_VM_SECTION START/END/PART/FULL)
*/
@@ -793,7 +786,7 @@ static void save_section_header(QEMUFile *f, SaveStateEntry *se,
*/
static void save_section_footer(QEMUFile *f, SaveStateEntry *se)
{
- if (!skip_section_footers) {
+ if (migrate_get_current()->send_section_footer) {
qemu_put_byte(f, QEMU_VM_SECTION_FOOTER);
qemu_put_be32(f, se->section_id);
}
@@ -1791,7 +1784,7 @@ static bool check_section_footer(QEMUFile *f, SaveStateEntry *se)
uint8_t read_mark;
uint32_t read_section_id;
- if (skip_section_footers) {
+ if (!migrate_get_current()->send_section_footer) {
/* No footer to check */
return true;
}
Move it into MigrationState, revert its meaning and renaming it to send_section_footer, with a property bound to it. Same trick is played like previous patches. Removing savevm_skip_section_footers(). Signed-off-by: Peter Xu <peterx@redhat.com> --- hw/i386/pc_piix.c | 1 - hw/ppc/spapr.c | 1 - hw/xen/xen-common.c | 2 +- include/hw/compat.h | 4 ++++ include/migration/misc.h | 1 - migration/migration.c | 2 ++ migration/migration.h | 2 ++ migration/savevm.c | 11 ++--------- 8 files changed, 11 insertions(+), 13 deletions(-)