From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usb1n-0007a6-Mc for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:56:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Usb1h-0003dZ-Pt for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:56:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44120 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usb1h-0003dN-JW for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:55:57 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F32DAA5396 for ; Fri, 28 Jun 2013 17:55:56 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 28 Jun 2013 17:55:25 +0200 Message-Id: <1372434946-18489-4-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 03/24] cpu: Introduce VMSTATE_CPU() macro for CPUState 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?= To be used to embed common CPU state into CPU subclasses. Reviewed-by: Juan Quintela Signed-off-by: Andreas F=C3=A4rber --- exec.c | 5 ++--- include/qom/cpu.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/exec.c b/exec.c index f99041b..0b172b4 100644 --- a/exec.c +++ b/exec.c @@ -330,7 +330,7 @@ static int cpu_common_post_load(void *opaque, int ver= sion_id) return 0; } =20 -static const VMStateDescription vmstate_cpu_common =3D { +const VMStateDescription vmstate_cpu_common =3D { .name =3D "cpu_common", .version_id =3D 1, .minimum_version_id =3D 1, @@ -342,8 +342,7 @@ static const VMStateDescription vmstate_cpu_common =3D= { VMSTATE_END_OF_LIST() } }; -#else -#define vmstate_cpu_common vmstate_dummy + #endif =20 CPUState *qemu_get_cpu(int index) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 397219b..3e8cc47 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -378,4 +378,18 @@ void cpu_reset_interrupt(CPUState *cpu, int mask); */ void cpu_resume(CPUState *cpu); =20 +#ifdef CONFIG_SOFTMMU +extern const struct VMStateDescription vmstate_cpu_common; +#else +#define vmstate_cpu_common vmstate_dummy +#endif + +#define VMSTATE_CPU() { = \ + .name =3D "parent_obj", = \ + .size =3D sizeof(CPUState), = \ + .vmsd =3D &vmstate_cpu_common, = \ + .flags =3D VMS_STRUCT, = \ + .offset =3D 0, = \ +} + #endif --=20 1.8.1.4