From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usb1o-0007aC-Cg for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:56:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Usb1i-0003e0-0b for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:56:04 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44122 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usb1h-0003dS-OS for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:55:57 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 28 Jun 2013 17:55:26 +0200 Message-Id: <1372434946-18489-5-git-send-email-afaerber@suse.de> In-Reply-To: <1372434946-18489-1-git-send-email-afaerber@suse.de> References: <1372434946-18489-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 04/24] target-alpha: Register VMStateDescription for AlphaCPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Commit b758aca1f6cdb175634812b79f5560c36c902d00 (target-alpha: Enable the alpha-softmmu target.) introduced cpu_{save,load}() functions but didn't define CPU_SAVE_VERSION, so they were never registered. Drop cpu_{save,load}() and register the VMStateDescription via DeviceClas= s. This operates on the AlphaCPU object instead of CPUAlphaState. Reviewed-by: Juan Quintela Acked-by: Richard Henderson Signed-off-by: Andreas F=C3=A4rber --- target-alpha/cpu-qom.h | 4 ++++ target-alpha/cpu.c | 2 ++ target-alpha/machine.c | 28 ++++++++++++++++------------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/target-alpha/cpu-qom.h b/target-alpha/cpu-qom.h index 32ee286..ee10ed6 100644 --- a/target-alpha/cpu-qom.h +++ b/target-alpha/cpu-qom.h @@ -74,6 +74,10 @@ static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaStat= e *env) =20 #define ENV_OFFSET offsetof(AlphaCPU, env) =20 +#ifndef CONFIG_USER_ONLY +extern const struct VMStateDescription vmstate_alpha_cpu; +#endif + void alpha_cpu_do_interrupt(CPUState *cpu); =20 #endif diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c index cad1716..8252cea 100644 --- a/target-alpha/cpu.c +++ b/target-alpha/cpu.c @@ -21,6 +21,7 @@ =20 #include "cpu.h" #include "qemu-common.h" +#include "migration/vmstate.h" =20 =20 static void alpha_cpu_realizefn(DeviceState *dev, Error **errp) @@ -264,6 +265,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, voi= d *data) =20 cc->class_by_name =3D alpha_cpu_class_by_name; cc->do_interrupt =3D alpha_cpu_do_interrupt; + device_class_set_vmsd(dc, &vmstate_alpha_cpu); } =20 static const TypeInfo alpha_cpu_type_info =3D { diff --git a/target-alpha/machine.c b/target-alpha/machine.c index 1c9edd1..889f2fc 100644 --- a/target-alpha/machine.c +++ b/target-alpha/machine.c @@ -20,7 +20,7 @@ static const VMStateInfo vmstate_fpcr =3D { .put =3D put_fpcr, }; =20 -static VMStateField vmstate_cpu_fields[] =3D { +static VMStateField vmstate_env_fields[] =3D { VMSTATE_UINTTL_ARRAY(ir, CPUAlphaState, 31), VMSTATE_UINTTL_ARRAY(fir, CPUAlphaState, 31), /* Save the architecture value of the fpcr, not the internally @@ -68,20 +68,24 @@ static VMStateField vmstate_cpu_fields[] =3D { VMSTATE_END_OF_LIST() }; =20 -static const VMStateDescription vmstate_cpu =3D { - .name =3D "cpu", +static const VMStateDescription vmstate_env =3D { + .name =3D "env", .version_id =3D 1, .minimum_version_id =3D 1, .minimum_version_id_old =3D 1, - .fields =3D vmstate_cpu_fields, + .fields =3D vmstate_env_fields, }; =20 -void cpu_save(QEMUFile *f, void *opaque) -{ - vmstate_save_state(f, &vmstate_cpu, opaque); -} +static VMStateField vmstate_cpu_fields[] =3D { + VMSTATE_CPU(), + VMSTATE_STRUCT(env, AlphaCPU, 1, vmstate_env, CPUAlphaState), + VMSTATE_END_OF_LIST() +}; =20 -int cpu_load(QEMUFile *f, void *opaque, int version_id) -{ - return vmstate_load_state(f, &vmstate_cpu, opaque, version_id); -} +const VMStateDescription vmstate_alpha_cpu =3D { + .name =3D "cpu", + .version_id =3D 1, + .minimum_version_id =3D 1, + .minimum_version_id_old =3D 1, + .fields =3D vmstate_cpu_fields, +}; --=20 1.8.1.4