From patchwork Mon Mar 19 22:57:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 147710 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 1EC0CB6EE6 for ; Tue, 20 Mar 2012 11:43:35 +1100 (EST) Received: from localhost ([::1]:35871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9lY5-0004un-Nv for incoming@patchwork.ozlabs.org; Mon, 19 Mar 2012 18:59:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9lWu-0002kj-Fu for qemu-devel@nongnu.org; Mon, 19 Mar 2012 18:58:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9lWj-0000qX-Ah for qemu-devel@nongnu.org; Mon, 19 Mar 2012 18:58:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9lWj-0000qE-3L for qemu-devel@nongnu.org; Mon, 19 Mar 2012 18:58:09 -0400 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 q2JMw7JE022717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Mar 2012 18:58:07 -0400 Received: from trasno.mitica (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q2JMw4oH017718; Mon, 19 Mar 2012 18:58:06 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 19 Mar 2012 23:57:29 +0100 Message-Id: <516d0c71ba99dc1a9099417178852e691182644b.1332197811.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 01/36] vmstate: Simplify test for CPU_SAVE_VERSION 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 Some cpu's definitions define CPU_SAVE_VERSION, others not, but they have defined cpu_save/load. Signed-off-by: Juan Quintela --- exec.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 265e895..9389a61 100644 --- a/exec.c +++ b/exec.c @@ -657,7 +657,7 @@ void cpu_exec_init_all(void) #endif } -#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY) +#if !defined(CONFIG_USER_ONLY) static int cpu_common_post_load(void *opaque, int version_id) { @@ -724,11 +724,13 @@ void cpu_exec_init(CPUArchState *env) #if defined(CONFIG_USER_ONLY) cpu_list_unlock(); #endif -#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY) +#if !defined(CONFIG_USER_ONLY) vmstate_register(NULL, cpu_index, &vmstate_cpu_common, env); +#if defined(CPU_SAVE_VERSION) register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION, cpu_save, cpu_load, env); #endif +#endif } /* Allocate a new translation block. Flush the translation buffer if