]> Git Repo - qemu.git/commitdiff
migration: move skip_section_footers
authorPeter Xu <[email protected]>
Tue, 27 Jun 2017 04:10:17 +0000 (12:10 +0800)
committerJuan Quintela <[email protected]>
Wed, 28 Jun 2017 09:18:39 +0000 (11:18 +0200)
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 <[email protected]>
Signed-off-by: Peter Xu <[email protected]>
Message-Id: <1498536619[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
hw/i386/pc_piix.c
hw/ppc/spapr.c
hw/xen/xen-common.c
include/hw/compat.h
include/migration/misc.h
migration/migration.c
migration/migration.h
migration/savevm.c

index 488fc0a7c03d3027f97f2572a976fdbf08e580bc..22dbef64c69b191d298a55ecdd6b7aaaeb184157 100644 (file)
@@ -314,7 +314,6 @@ static void pc_init1(MachineState *machine,
 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;
     }
index 84291877ef5ecdfb38049202b7d67a491a4dee22..ea44358e300d0eec2c77c23b384f0c92b0feba5c 100644 (file)
@@ -3580,7 +3580,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)
index 1f3688d2ff6903e14bd22834420081670495eb8b..632a938dcc82144ee88e3f33ef7343f90a6a9db4 100644 (file)
@@ -138,9 +138,6 @@ static int xen_init(MachineState *ms)
         return -1;
     }
     qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);
-
-    savevm_skip_section_footers();
-
     return 0;
 }
 
@@ -155,6 +152,11 @@ static GlobalProperty xen_compat_props[] = {
         .property = "send-configuration",
         .value = "off",
     },
+    {
+        .driver = "migration",
+        .property = "send-section-footer",
+        .value = "off",
+    },
     { /* end of list */ },
 };
 
index 1a3fd9443ad2812c050a0dc3d5eed3a3a16aafeb..08f36004dad7fda9f18a0f82d56e7dca4051480d 100644 (file)
         .driver   = "migration",\
         .property = "send-configuration",\
         .value    = "off",\
+    },{\
+        .driver   = "migration",\
+        .property = "send-section-footer",\
+        .value    = "off",\
     },{\
         .driver   = "migration",\
         .property = "store-global-state",\
index f30db4d778c6a31ecc0b707f8b21c45a8c59e887..854c28d9d3b6a64409919121cdc735fce3896fb0 100644 (file)
@@ -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 migration_object_init(void);
index 414e14db6cf8eaf35f62f0f83f889a55e713bcc1..96c641283bca905f2112f2ee3ff31830d6579c07 100644 (file)
@@ -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(),
 };
 
index 4d4ea0debfab0dc33b6dc2c39f0f97cfbc3b321f..994b01701503d336d6e0a0277ce407e0b1a05fb5 100644 (file)
@@ -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);
index 0a8c61f52fa4ee9f0ab5d2e465b1af0400f79d21..7b39fb9a81aafb279e66e704cca7024f1a5eb961 100644 (file)
@@ -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;
     }
This page took 0.044542 seconds and 4 git commands to generate.