aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-06-27 12:10:17 +0800
committerJuan Quintela <quintela@redhat.com>2017-06-28 11:18:39 +0200
commit15c38503253bb9ba9b8efd17662069f69ca2b997 (patch)
tree75a5779c345665085ff9846e26a521cb39e515c0 /migration
parent71dd4c1a5672cafe9fb89abc83fe2a962f39ec42 (diff)
migration: move skip_section_footers
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(). Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1498536619-14548-9-git-send-email-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c2
-rw-r--r--migration/migration.h2
-rw-r--r--migration/savevm.c11
3 files changed, 6 insertions, 9 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 414e14db6c..96c641283b 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -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(),
};
diff --git a/migration/migration.h b/migration/migration.h
index 4d4ea0debf..994b017015 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -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);
diff --git a/migration/savevm.c b/migration/savevm.c
index 0a8c61f52f..7b39fb9a81 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -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);
}
@@ -1802,7 +1795,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;
}