From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Stefan Hajnoczi 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 1/4] target-moxie: Fix VMState registration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori 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=C3=A4rber 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) =20 cc->class_by_name =3D moxie_cpu_class_by_name; =20 - dc->vmsd =3D &vmstate_moxie_cpu; + cpu_class_set_vmsd(cc, &vmstate_moxie_cpu); cc->do_interrupt =3D moxie_cpu_do_interrupt; } =20 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 @@ =20 #define TARGET_HAS_ICE 1 =20 -#define CPU_SAVE_VERSION 1 - #define ELF_MACHINE 0xFEED /* EM_MOXIE */ =20 #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 @@ =20 const VMStateDescription vmstate_moxie_cpu =3D { .name =3D "cpu", - .version_id =3D CPU_SAVE_VERSION, + .version_id =3D 1, .minimum_version_id =3D 1, .minimum_version_id_old =3D 1, .fields =3D (VMStateField[]) { @@ -16,13 +16,3 @@ const VMStateDescription vmstate_moxie_cpu =3D { 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)= ; -} --=20 1.8.1.4