From patchwork Sun May 17 15:43:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 24327 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4HFhs9h013044 for ; Sun, 17 May 2009 15:43:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754759AbZEQPns (ORCPT ); Sun, 17 May 2009 11:43:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754721AbZEQPnq (ORCPT ); Sun, 17 May 2009 11:43:46 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:54503 "EHLO e4.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754681AbZEQPnm (ORCPT ); Sun, 17 May 2009 11:43:42 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4HFdPMX022304 for ; Sun, 17 May 2009 11:39:25 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4HFhgs4201776 for ; Sun, 17 May 2009 11:43:42 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4HFfgIN030602 for ; Sun, 17 May 2009 11:41:42 -0400 Received: from localhost.localdomain (sig-9-65-8-189.mts.ibm.com [9.65.8.189]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n4HFfPca030035; Sun, 17 May 2009 11:41:41 -0400 From: Anthony Liguori To: kvm@vger.kernel.org Cc: Glauber Costa , Anthony Liguori , Avi Kivity Subject: [PATCH 13/17] Increment version id for CPU save state Date: Sun, 17 May 2009 10:43:15 -0500 Message-Id: <1242574999-20887-15-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1242574999-20887-1-git-send-email-aliguori@us.ibm.com> References: <1242574999-20887-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 9 is reserved for KVM. KVM cannot support migration from any other version. [aliguori: incorporated Glauber's fix for save/restore breakage] Signed-off-by: Anthony Liguori Signed-off-by: Avi Kivity diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 2f8b4f6..367b4be 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -836,7 +836,9 @@ static inline int cpu_get_time_fast(void) #define cpu_signal_handler cpu_x86_signal_handler #define cpu_list x86_cpu_list -#define CPU_SAVE_VERSION 8 +/* CPU_SAVE_VERSION 9 is reserved for KVM. This is to avoid breakage as KVM + * merges into upstream QEMU */ +#define CPU_SAVE_VERSION 9 /* MMU modes definitions */ #define MMU_MODE0_SUFFIX _kernel diff --git a/target-i386/machine.c b/target-i386/machine.c index a006286..5713659 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -191,7 +191,11 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) int32_t a20_mask; if (version_id != 3 && version_id != 4 && version_id != 5 - && version_id != 6 && version_id != 7 && version_id != 8) + && version_id != 6 && version_id != 7 && version_id != 8 + && version_id != 9) + return -EINVAL; + /* KVM cannot accept migrations from QEMU today */ + if (version_id != 9) return -EINVAL; for(i = 0; i < CPU_NB_REGS; i++) qemu_get_betls(f, &env->regs[i]);