From patchwork Fri Apr 12 14:38:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 236122 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 5DA652C00B6 for ; Sat, 13 Apr 2013 00:39:11 +1000 (EST) Received: from localhost ([::1]:34036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQf89-000442-Kc for incoming@patchwork.ozlabs.org; Fri, 12 Apr 2013 10:39:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQf7X-0003tR-Mt for qemu-devel@nongnu.org; Fri, 12 Apr 2013 10:38:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQf7T-0004LO-5A for qemu-devel@nongnu.org; Fri, 12 Apr 2013 10:38:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQf7S-0004L5-SU for qemu-devel@nongnu.org; Fri, 12 Apr 2013 10:38:27 -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 r3CEcQ7w018306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Apr 2013 10:38:26 -0400 Received: from localhost (ovpn-112-42.ams2.redhat.com [10.36.112.42]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3CEcOwh027492; Fri, 12 Apr 2013 10:38:25 -0400 From: Stefan Hajnoczi To: Date: Fri, 12 Apr 2013 16:38:19 +0200 Message-Id: <1365777502-7035-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1365777502-7035-1-git-send-email-stefanha@redhat.com> References: <1365777502-7035-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r3CEcQ7w018306 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH 1/4] target-moxie: Fix VMState registration 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: Peter Maydell Register the CPU VMState in the correct way, via cpu_class_set_vmsd(), rather than doing it in two different wrong ways (once by providing cpu_save and cpu_load functions, and once by setting the vmsd field in DeviceClass). Signed-off-by: Peter Maydell Reviewed-by: Andreas Färber Signed-off-by: Stefan Hajnoczi --- target-moxie/cpu.c | 2 +- target-moxie/cpu.h | 2 -- target-moxie/machine.c | 12 +----------- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/target-moxie/cpu.c b/target-moxie/cpu.c index c0855f0..f2b0791 100644 --- a/target-moxie/cpu.c +++ b/target-moxie/cpu.c @@ -97,7 +97,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = moxie_cpu_class_by_name; - dc->vmsd = &vmstate_moxie_cpu; + cpu_class_set_vmsd(cc, &vmstate_moxie_cpu); cc->do_interrupt = moxie_cpu_do_interrupt; } diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h index 988729a..a9d9ace 100644 --- a/target-moxie/cpu.h +++ b/target-moxie/cpu.h @@ -28,8 +28,6 @@ #define TARGET_HAS_ICE 1 -#define CPU_SAVE_VERSION 1 - #define ELF_MACHINE 0xFEED /* EM_MOXIE */ #define MOXIE_EX_DIV0 0 diff --git a/target-moxie/machine.c b/target-moxie/machine.c index 5bfdb28..0f5992b 100644 --- a/target-moxie/machine.c +++ b/target-moxie/machine.c @@ -3,7 +3,7 @@ const VMStateDescription vmstate_moxie_cpu = { .name = "cpu", - .version_id = CPU_SAVE_VERSION, + .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, .fields = (VMStateField[]) { @@ -16,13 +16,3 @@ const VMStateDescription vmstate_moxie_cpu = { VMSTATE_END_OF_LIST() } }; - -void cpu_save(QEMUFile *f, void *opaque) -{ - vmstate_save_state(f, &vmstate_moxie_cpu, opaque); -} - -int cpu_load(QEMUFile *f, void *opaque, int version_id) -{ - return vmstate_load_state(f, &vmstate_moxie_cpu, opaque, version_id); -}