From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRRWM-0005co-2w for qemu-devel@nongnu.org; Mon, 07 May 2012 13:14:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRRWK-00086b-9y for qemu-devel@nongnu.org; Mon, 07 May 2012 13:14:49 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38929 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRRWK-00085u-04 for qemu-devel@nongnu.org; Mon, 07 May 2012 13:14:48 -0400 Message-ID: <4FA80306.7020101@suse.de> Date: Mon, 07 May 2012 19:14:46 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <03886a52f402947d679b559c227acbede52e6c0d.1336128412.git.quintela@redhat.com> <4FA400C9.20405@suse.de> In-Reply-To: <4FA400C9.20405@suse.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/35] vmstate: make all architectures export a way to migrate cpu's List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org Am 04.05.2012 18:16, schrieb Andreas F=E4rber: > Am 04.05.2012 12:54, schrieb Juan Quintela: >> This makes several changes: >> - exports VMStateDescription vmstate_cpu non-static. >> - makes sure that every cpu has a vmstate_cpu or cpu_save/load defined >> - for the architecture that had nothing, it just register the cpu as u= nmigratable. >> - Depending on CPU_SAVE_VERSION we register old/new migration style >> - Add copyrights to the new files >> >> Signed-off-by: Juan Quintela >> --- >> exec.c | 2 ++ >> target-alpha/machine.c | 12 +----------- >> target-i386/machine.c | 2 +- >> target-lm32/machine.c | 2 +- >> target-m68k/machine.c | 21 +++++++++++++++++++++ >> target-s390x/machine.c | 14 ++++++-------- >> target-sh4/machine.c | 21 +++++++++++++++++++++ >> target-xtensa/machine.c | 14 ++++++-------- >> vmstate.h | 2 ++ >> 9 files changed, 61 insertions(+), 29 deletions(-) [...] > We have QOM CPUState now, so please add a vmsd field to CPUClass instea= d > of exporting global vmstate_cpu variables. Thinking more about this, I see that we will need to assign it in cpu.c:xxx_class_init() (translate_init.c for ppc) as opposed to machine.c= . The declaration still shouldn't go into vmstate.h so that it remains a target-local decision how to model this (think CPU subclasses). I'd hate to #include "machine.c" in cpu.c. Having the declaration in cpu.h is the least intrusive solution I see. Moving the code into cpu.c would match qdev but would bloat the files. What do you think? > It then matches what we do > for former qdev devices and will in the future allow to compile this > code only twice. BTW the easiest way to address my comment on 01/35 would be to simply squash the two commits. :) Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg