Received: from eggs.gnu.org ([208.118.235.92]:57754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVDNR-0003Ti-JH for qemu-devel@nongnu.org; Thu, 17 May 2012 22:57:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVDNP-0005Uo-Pz for qemu-devel@nongnu.org; Thu, 17 May 2012 22:57:13 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:11073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVDNO-0005UG-Fj for qemu-devel@nongnu.org; Thu, 17 May 2012 22:57:11 -0400 Date: Fri, 18 May 2012 10:56:49 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7?= Message-ID: <20120518025649.GA88174@cs.nctu.edu.tw> References: <1337243758-11802-1-git-send-email-proljc@gmail.com> <1337243758-11802-2-git-send-email-proljc@gmail.com> <4FB507B7.2060806@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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: Andreas =?utf-8?B?RumFumJlcg==?= , qemu-devel@nongnu.org > > This is a mix of two ways of doing the same thing. You should only us= e > > VMState for new code. > > >=20 > did you mean I should not use QEMUFile? I guess what Andreas means is there are two ways to do cpu_save/cpu_loa= d, the one you wrote is the old style. For the brand new target, you should = use VMState completely. You can take target-lm32/machine.c as an example. --- void cpu_save(QEMUFile *f, void *opaque) { vmstate_save_state(f, &vmstate_cpu, opaque); } int cpu_load(QEMUFile *f, void *opaque, int version_id) { return vmstate_load_state(f, &vmstate_cpu, opaque, version_id); } --- Leave to vmstate_save_state/vmstate_load_state (savevm.c) do the real t= hings. Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj