From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4eXb-00059h-KF for qemu-devel@nongnu.org; Wed, 31 Jul 2013 18:06:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4eXV-0005Pn-EX for qemu-devel@nongnu.org; Wed, 31 Jul 2013 18:06:43 -0400 Received: from cantor2.suse.de ([195.135.220.15]:54469 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4eXV-0005PO-6y for qemu-devel@nongnu.org; Wed, 31 Jul 2013 18:06:37 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 1 Aug 2013 00:06:26 +0200 Message-Id: <1375308386-10533-2-git-send-email-afaerber@suse.de> In-Reply-To: <1375308386-10533-1-git-send-email-afaerber@suse.de> References: <1375308386-10533-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 1/1] cpu: Fix VMSTATE_CPU() semantics 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 1a1562f5ea3da17d45d3829e35b5f49da9ec2db5 prepared a VMSTATE_CPU() macro for device-style VMStateDescription registration, but missed to adapt cpu_exec_init(), so that the "cpu_common" VMStateDescription was still registered for AlphaCPU (fe31e7374299c0c6172ce618b29bf2fecbd881c7) and OpenRISCCPU (da69721460e652072b6a3dd52b7693da21ffe237). Fix this. Cc: Richard Henderson Tested-by: Jia Liu Signed-off-by: Andreas F=C3=A4rber --- exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index c4f2894..3ca9381 100644 --- a/exec.c +++ b/exec.c @@ -402,11 +402,14 @@ void cpu_exec_init(CPUArchState *env) #if defined(CONFIG_USER_ONLY) cpu_list_unlock(); #endif - vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu); + if (qdev_get_vmsd(DEVICE(cpu)) =3D=3D NULL) { + vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu); + } #if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY) register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION, cpu_save, cpu_load, env); assert(cc->vmsd =3D=3D NULL); + assert(qdev_get_vmsd(DEVICE(cpu)) =3D=3D NULL); #endif if (cc->vmsd !=3D NULL) { vmstate_register(NULL, cpu_index, cc->vmsd, cpu); --=20 1.8.1.4