Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mnw7k-0000d5-V5 for qemu-devel@nongnu.org; Wed, 16 Sep 2009 11:08:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mnw7g-0000Yj-DN for qemu-devel@nongnu.org; Wed, 16 Sep 2009 11:08:48 -0400 Received: from [199.232.76.173] (port=50082 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mnw7f-0000YP-US for qemu-devel@nongnu.org; Wed, 16 Sep 2009 11:08:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47768) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mnw7f-0004lL-DA for qemu-devel@nongnu.org; Wed, 16 Sep 2009 11:08:43 -0400 From: Juan Quintela In-Reply-To: <200909161437.AA00108@YOUR-BD18D6DD63.m1.interq.or.jp> (toshiya TAKEDA's message of "Wed, 16 Sep 2009 23:37:36 +0900") References: <200909161437.AA00108@YOUR-BD18D6DD63.m1.interq.or.jp> Date: Wed, 16 Sep 2009 17:08:27 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] fdc: fix MAX_FD probelm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "TAKEDA, toshiya" Cc: qemu-devel@nongnu.org "TAKEDA, toshiya" wrote: > Dear Juan and members, > >>t-takeda@m1.interq.or.jp (=E6=AD=A6=E7=94=B0 =E4=BF=8A=E4=B9=9F) wrote: >>> Dear members, >> >>Hi >>> static const VMStateDescription vmstate_fdc =3D { >>> .name =3D "fdc", >>> - .version_id =3D 2, >>> - .minimum_version_id =3D 2, >>> - .minimum_version_id_old =3D 2, >>> + .version_id =3D 3, >>> + .minimum_version_id =3D 3, >>> + .minimum_version_id_old =3D 3, >> >>This is wrong. You can't move to version 3 without a good reason. And >>if you move, you have to retain backward compatibility). > > >>> .pre_save =3D fdc_pre_save, >>> .post_load =3D fdc_post_load, >>> .fields =3D (VMStateField []) { >>> @@ -692,7 +694,7 @@ static const VMStateDescription vmstate_fdc =3D { >>> VMSTATE_UINT8(lock, fdctrl_t), >>> VMSTATE_UINT8(pwrd, fdctrl_t), >>> VMSTATE_UINT8_EQUAL(num_floppies, fdctrl_t), >>> - VMSTATE_STRUCT_ARRAY(drives, fdctrl_t, MAX_FD, 1, >>> + VMSTATE_STRUCT_ARRAY(drives, fdctrl_t, MAX_LOGICAL_FD, 1, >> >>Will send a patch with support for: >> >>VMSTATE_STRUCT_ARRAY(drives, fdctrl_t, num_floppies, 1, wmstate_fdrive, >>fdrive_t) > > Well, it seems that we cannot specify the variable to WMSTATE_STRUCT_ARRA= Y. > And I found the problem that, > if I defined fdctrl_t->drives as fdrive_t drives[MAX_LOGICAL_FD]; > and specify MAX_FD as VMSTATE_STRUCT_ARRAY(drives, fdctrl_t, MAX_FD, ...) > it cause the build error on MinGW. > It seems that we need to specify the same constant value. I sent patch to support it. Current code is to send whole arrays (and it complains if array size and what you send is not the same). This are the hearders of the mail that gets its support (not tested) From: Juan Quintela Subject: [PATCH 4/4] vmstate: Add support for sending partial arrays To: qemu-devel@nongnu.org Date: Mon, 14 Sep 2009 22:15:21 +0200 Later, Juan.