From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnL98-00044q-Tu for qemu-devel@nongnu.org; Sun, 01 Dec 2013 23:30:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnL94-0004YM-Nn for qemu-devel@nongnu.org; Sun, 01 Dec 2013 23:30:10 -0500 Received: from [222.73.24.84] (port=15883 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnL94-0004F3-Bb for qemu-devel@nongnu.org; Sun, 01 Dec 2013 23:30:06 -0500 Message-ID: <529C0C5B.3010307@cn.fujitsu.com> Date: Mon, 02 Dec 2013 12:28:11 +0800 From: Li Guang MIME-Version: 1.0 References: <1385540635-26977-1-git-send-email-lig.fnst@cn.fujitsu.com> <1385540635-26977-2-git-send-email-lig.fnst@cn.fujitsu.com> In-Reply-To: Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8; format=flowed Subject: Re: [Qemu-devel] [PATCH v6 1/5] hw/ptimer: add VMSTATE_PTIMER_ARRAY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Peter Crosthwaite , QEMU Developers Peter Maydell wrote: > On 29 November 2013 11:01, Peter Maydell wrote: > >> On 27 November 2013 08:23, liguang wrote: >> >>> Signed-off-by: liguang >>> --- >>> include/hw/ptimer.h | 3 +++ >>> 1 files changed, 3 insertions(+), 0 deletions(-) >>> >>> diff --git a/include/hw/ptimer.h b/include/hw/ptimer.h >>> index 28fcaf1..a9b8f1d 100644 >>> --- a/include/hw/ptimer.h >>> +++ b/include/hw/ptimer.h >>> @@ -27,6 +27,9 @@ void ptimer_stop(ptimer_state *s); >>> >>> extern const VMStateDescription vmstate_ptimer; >>> >>> +#define VMSTATE_PTIMER_ARRAY(_f, _s, _n) \ >>> + VMSTATE_STRUCT_ARRAY(_f, _s, _n, 0, vmstate_ptimer, ptimer_state*) >>> >> The final parameter here should just be the struct type >> ("ptimer_state"), not a pointer-to-it. >> > Actually, looking at the patch where you've used this, > you do actually want to deal with an > array-of-pointers-to-ptimers. For that you need > > #define VMSTATE_PTIMER_ARRAY(_f, _s, _n) \ > VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, 0, vmstate_ptimer, ptimer_state *) > > (compare VMSTATE_TIMER_ARRAY in vmstate.h) > > > OK, thanks!