From patchwork Mon Jul 29 02:20:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 262644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4427A2C0127 for ; Mon, 29 Jul 2013 12:21:27 +1000 (EST) Received: from localhost ([::1]:55851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3d5R-0002CI-BT for incoming@patchwork.ozlabs.org; Sun, 28 Jul 2013 22:21:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3d56-0002C0-HC for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:21:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3d51-0002MV-42 for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:21:04 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46581 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3d50-0002MQ-U5 for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:20:59 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 316C2A51FE; Mon, 29 Jul 2013 04:20:58 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2013 04:20:46 +0200 Message-Id: <1375064446-15467-1-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Jia Liu , Richard Henderson , =?UTF-8?q?Andreas=20F=C3=A4rber?= , quintela@redhat.com Subject: [Qemu-devel] [PATCH qom-cpu for-1.6] cpu: Fix VMSTATE_CPU() semantics 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 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 Cc: Jia Liu Signed-off-by: Andreas Färber Tested-by: Jia Liu --- 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)) == 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 == NULL); + assert(qdev_get_vmsd(DEVICE(cpu)) == NULL); #endif if (cc->vmsd != NULL) { vmstate_register(NULL, cpu_index, cc->vmsd, cpu);