From patchwork Tue May 19 11:29:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 473849 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 74965140D4D for ; Tue, 19 May 2015 21:30:37 +1000 (AEST) Received: from localhost ([::1]:45101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YufjH-0007T7-I1 for incoming@patchwork.ozlabs.org; Tue, 19 May 2015 07:30:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yufii-0006Zz-2W for qemu-devel@nongnu.org; Tue, 19 May 2015 07:30:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yufih-0003Qm-50 for qemu-devel@nongnu.org; Tue, 19 May 2015 07:30:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yufig-0003Qf-Sb for qemu-devel@nongnu.org; Tue, 19 May 2015 07:29:59 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4JBTwh9003505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 May 2015 07:29:58 -0400 Received: from dgilbert-t530.redhat.com (ovpn-116-80.ams2.redhat.com [10.36.116.80]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4JBTr0R018406; Tue, 19 May 2015 07:29:57 -0400 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Tue, 19 May 2015 12:29:51 +0100 Message-Id: <1432034993-24431-3-git-send-email-dgilbert@redhat.com> In-Reply-To: <1432034993-24431-1-git-send-email-dgilbert@redhat.com> References: <1432034993-24431-1-git-send-email-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: amit.shah@redhat.com, agraf@suse.de, quintela@redhat.com Subject: [Qemu-devel] [PATCH 2/4] Disable section footers on older machine types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Dr. David Alan Gilbert" 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 Reviewed-by: Juan Quintela --- hw/i386/pc_piix.c | 2 ++ hw/i386/pc_q35.c | 2 ++ include/migration/migration.h | 1 + savevm.c | 7 +++++++ 4 files changed, 12 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 212e263..dd4c826 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -52,6 +52,7 @@ #ifdef CONFIG_XEN # include #endif +#include "migration/migration.h" #define MAX_IDE_BUS 2 @@ -312,6 +313,7 @@ static void pc_init_pci(MachineState *machine) static void pc_compat_2_3(MachineState *machine) { + savevm_skip_section_footers(); } static void pc_compat_2_2(MachineState *machine) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index e67f2de..3fea169 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -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 @@ -291,6 +292,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) diff --git a/include/migration/migration.h b/include/migration/migration.h index a6e025a..9afee02 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -180,4 +180,5 @@ 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 savevm_skip_section_footers(void); #endif diff --git a/savevm.c b/savevm.c index edb8f33..415914f 100644 --- a/savevm.c +++ b/savevm.c @@ -51,6 +51,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) { @@ -602,6 +604,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) */