From patchwork Tue Feb 19 22:40:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 221912 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7BE5C2C0091 for ; Wed, 20 Feb 2013 09:40:43 +1100 (EST) Received: from localhost ([::1]:51329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7vrd-0000Bl-7S for incoming@patchwork.ozlabs.org; Tue, 19 Feb 2013 17:40:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7vrR-00009b-0w for qemu-devel@nongnu.org; Tue, 19 Feb 2013 17:40:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7vrM-0008Fw-Uc for qemu-devel@nongnu.org; Tue, 19 Feb 2013 17:40:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7vrM-0008C5-La; Tue, 19 Feb 2013 17:40:24 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1JMeIpk010159 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Feb 2013 17:40:18 -0500 Received: from colepc.redhat.com (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1JMe6CZ011875; Tue, 19 Feb 2013 17:40:11 -0500 From: Cole Robinson To: qemu-devel@nongnu.org Date: Tue, 19 Feb 2013 17:40:00 -0500 Message-Id: In-Reply-To: <447a8e1d1d24ed89db081c9c912627335267bfbc.1361313340.git.crobinso@redhat.com> References: <447a8e1d1d24ed89db081c9c912627335267bfbc.1361313340.git.crobinso@redhat.com> In-Reply-To: <447a8e1d1d24ed89db081c9c912627335267bfbc.1361313340.git.crobinso@redhat.com> References: <447a8e1d1d24ed89db081c9c912627335267bfbc.1361313340.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , Marcelo Tosatti , qemu-stable , Cole Robinson Subject: [Qemu-devel] [PATCH 2/4] acpi_piix4: Drop minimum_version_id to handle qemu-kvm migration 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 qemu-kvm 1.2 advertised version_id=2, but it was not the same format as qemu.git version_id=2. commit b0b873a07872f7ab7f66f259c73fb9dd42aa66a9 added the qemu-kvm format to qemu.git, but was forced to call it version_id=3, and bumped minimum_version_id to 3. This breaks incoming migration from qemu-kvm. If --enable-migration-from-qemu-kvm is enabled, drop minimum_version_id to 2. Migration from qemu-kvm version_id=2 and qemu 1.3+ version_id=3 works, but migration from qemu < 1.3 is broken. Signed-off-by: Cole Robinson --- hw/acpi_piix4.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 65b2601..e3d2e41 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -257,16 +257,19 @@ static int acpi_load_old(QEMUFile *f, void *opaque, int version_id) return ret; } -/* qemu-kvm 1.2 uses version 3 but advertised as 2 - * To support incoming qemu-kvm 1.2 migration, change version_id - * and minimum_version_id to 2 below (which breaks migration from - * qemu 1.2). - * - */ static const VMStateDescription vmstate_acpi = { .name = "piix4_pm", .version_id = 3, +#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM + /* + * qemu-kvm 1.2 uses qemu.git version 3 format, but advertised as 2. + * This allows incoming migration from qemu-kvm, but breaks incoming + * migration from qemu < 1.3. + */ + .minimum_version_id = 2, +#else .minimum_version_id = 3, +#endif .minimum_version_id_old = 1, .load_state_old = acpi_load_old, .post_load = vmstate_acpi_post_load,