Disable section footers on older machine types
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 19 May 2015 11:29:51 +0000 (12:29 +0100)
committerJuan Quintela <quintela@redhat.com>
Fri, 12 Jun 2015 04:54:01 +0000 (06:54 +0200)
The next patch adds section footers; but we don't want to
break migration compatibility so disable them on older
machine types

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
hw/i386/pc_piix.c
hw/i386/pc_q35.c
include/migration/migration.h
migration/savevm.c

index 5253e6d4faaa1cc1ed1105c5ac2ec6be63684798..e142f75649d8cfd516636e39db6b041576f30294 100644 (file)
@@ -52,6 +52,7 @@
 #ifdef CONFIG_XEN
 #  include <xen/hvm/hvm_info_table.h>
 #endif
+#include "migration/migration.h"
 
 #define MAX_IDE_BUS 2
 
@@ -305,6 +306,7 @@ static void pc_init1(MachineState *machine)
 
 static void pc_compat_2_3(MachineState *machine)
 {
+    savevm_skip_section_footers();
 }
 
 static void pc_compat_2_2(MachineState *machine)
index 110dfb78a89f6c5831aceb96a5afbbbaca175410..b68263d231ccec6b775630d44f9be4f571ecb3d7 100644 (file)
@@ -45,6 +45,7 @@
 #include "hw/usb.h"
 #include "hw/cpu/icc_bus.h"
 #include "qemu/error-report.h"
+#include "migration/migration.h"
 
 /* ICH9 AHCI has 6 ports */
 #define MAX_SATA_PORTS     6
@@ -289,6 +290,7 @@ static void pc_q35_init(MachineState *machine)
 
 static void pc_compat_2_3(MachineState *machine)
 {
+    savevm_skip_section_footers();
 }
 
 static void pc_compat_2_2(MachineState *machine)
index 720a949f0b7aae3bbd107ce9f31843e8d7cd846d..7bdaf5593ec6d12f25604418aefd5065fd2afe0b 100644 (file)
@@ -194,6 +194,6 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset,
                              ram_addr_t offset, size_t size,
                              uint64_t *bytes_sent);
 
-
 void ram_mig_init(void);
+void savevm_skip_section_footers(void);
 #endif
index 2942ed6563271dc2c233e4cec9c3b58d436e82f8..80c4389ac4be74fd791179bb9bc25dd25f41ef74 100644 (file)
@@ -55,6 +55,8 @@
 #define ARP_PTYPE_IP 0x0800
 #define ARP_OP_REQUEST_REV 0x3
 
+static bool skip_section_footers;
+
 static int announce_self_create(uint8_t *buf,
                                 uint8_t *mac_addr)
 {
@@ -611,6 +613,11 @@ 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)
  */