From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mwvpo-0000RX-Tz for qemu-devel@nongnu.org; Sun, 11 Oct 2009 06:39:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mwvpj-0000N0-Vl for qemu-devel@nongnu.org; Sun, 11 Oct 2009 06:39:28 -0400 Received: from [199.232.76.173] (port=41084 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mwvpj-0000Ml-Q2 for qemu-devel@nongnu.org; Sun, 11 Oct 2009 06:39:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62472) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mwvpj-0001ew-AP for qemu-devel@nongnu.org; Sun, 11 Oct 2009 06:39:23 -0400 Date: Sun, 11 Oct 2009 12:37:16 +0200 From: "Michael S. Tsirkin" Message-ID: <20091011103716.GB15567@redhat.com> References: <1255069742-15724-1-git-send-email-yamahata@valinux.co.jp> <1255069742-15724-23-git-send-email-yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1255069742-15724-23-git-send-email-yamahata@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH V5 22/29] vmstate: add VMSTATE_ARRAY_POINTER for pointer to array. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On Fri, Oct 09, 2009 at 03:28:55PM +0900, Isaku Yamahata wrote: > add VMSTATE_ARRAY_POINTER for pointer to array. > This will be used later. > > Signed-off-by: Isaku Yamahata > --- > hw/hw.h | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/hw/hw.h b/hw/hw.h > index 8c223f8..e867af4 100644 > --- a/hw/hw.h > +++ b/hw/hw.h > @@ -389,6 +389,16 @@ extern const VMStateInfo vmstate_info_buffer; > + type_check_array(_type,typeof_field(_state, _field),_num) \ > } > > +#define VMSTATE_ARRAY_POINTER(_field, _state, _version, _info, _type, _size) { \ > + .name = (stringify(_field)), \ > + .version_id = (_version), \ > + .size = (_size), \ > + .info = &(_info), \ > + .flags = VMS_SINGLE | VMS_POINTER, \ > + .offset = offsetof(_state, _field) \ > + + type_check(_type,typeof_field(_state, _field)) \ > +} > + This is really just VMSTATE_POINTER, array pointer implies char** IMO. Also please use a wrapper so that users don't have to repeat typeof_field(_state, _field). > #define VMSTATE_VARRAY(_field, _state, _field_num, _version, _info, _type) {\ > .name = (stringify(_field)), \ > .version_id = (_version), \ > -- > 1.6.0.2