From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SW6u6-0002Qh-1z for qemu-devel@nongnu.org; Sun, 20 May 2012 10:14:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SW6u4-0007RH-EX for qemu-devel@nongnu.org; Sun, 20 May 2012 10:14:37 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52122 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SW6u4-0007RB-8B for qemu-devel@nongnu.org; Sun, 20 May 2012 10:14:36 -0400 Message-ID: <4FB8FC42.4040700@suse.de> Date: Sun, 20 May 2012 16:14:26 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1337243758-11802-1-git-send-email-proljc@gmail.com> <1337243758-11802-2-git-send-email-proljc@gmail.com> <4FB507B7.2060806@suse.de> <20120518025649.GA88174@cs.nctu.edu.tw> In-Reply-To: <20120518025649.GA88174@cs.nctu.edu.tw> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jia Liu Cc: qemu-devel@nongnu.org, =?UTF-8?B?6Zmz6Z+L5Lu7?= , Juan Quintela Am 18.05.2012 04:56, schrieb =E9=99=B3=E9=9F=8B=E4=BB=BB: >>> This is a mix of two ways of doing the same thing. You should only us= e >>> VMState for new code. >>> >> >> did you mean I should not use QEMUFile? >=20 > I guess what Andreas means is there are two ways to do cpu_save/cpu_l= oad, > the one you wrote is the old style. For the brand new target, you shoul= d use > VMState completely. Exactly what I meant. Although I'm working towards making that even easier by leveraging code from Juan's vmstate series and having the CPUs just store a pointer to their VMStateDescription like devices do. Andreas > You can take target-lm32/machine.c as an example. >=20 > --- > void cpu_save(QEMUFile *f, void *opaque) > { > vmstate_save_state(f, &vmstate_cpu, opaque); > } >=20 > int cpu_load(QEMUFile *f, void *opaque, int version_id) > { > return vmstate_load_state(f, &vmstate_cpu, opaque, version_id); > } > --- >=20 > Leave to vmstate_save_state/vmstate_load_state (savevm.c) do the real= things. >=20 > Regards, > chenwj >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg