From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwBxL-000291-Fp for qemu-devel@nongnu.org; Tue, 31 Jul 2012 08:53:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwBxF-0001RE-LQ for qemu-devel@nongnu.org; Tue, 31 Jul 2012 08:53:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwBxF-0001R4-DY for qemu-devel@nongnu.org; Tue, 31 Jul 2012 08:53:41 -0400 Message-ID: <5017D54B.9050206@redhat.com> Date: Tue, 31 Jul 2012 14:53:31 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1343417387-13953-1-git-send-email-i.mitsyanko@samsung.com> <1343417387-13953-12-git-send-email-i.mitsyanko@samsung.com> <87y5m0gssn.fsf@blackfin.pond.sub.org> <5017CD60.4060705@suse.de> In-Reply-To: <5017CD60.4060705@suse.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V4 11/12] SD card: introduce "spi" property for SD card objects List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: kwolf@redhat.com, peter.maydell@linaro.org, benoit.canet@gmail.com, Igor Mitsyanko , stefanha@linux.vnet.ibm.com, e.voevodin@samsung.com, Markus Armbruster , qemu-devel@nongnu.org, andrew.zaborowski@intel.com, kyungmin.park@samsung.com, wdongxu@linux.vnet.ibm.com Il 31/07/2012 14:19, Andreas F=E4rber ha scritto: >>> >> + sd->spi =3D false; >>> >> + object_property_add(obj, "spi", "boolean", sd_is_spi, sd_set_= spimode, >>> >> + NULL, NULL, NULL); >>> >> +} >>> >> + >>> >> static const TypeInfo sd_type_info =3D { >>> >> .name =3D TYPE_SD_CARD, >>> >> .parent =3D TYPE_OBJECT, >>> >> .instance_size =3D sizeof(SDState), >>> >> + .instance_init =3D sd_initfn, >>> >> .class_init =3D sd_class_init, >>> >> .class_size =3D sizeof(SDClass) >>> >> }; >> >=20 >> > I suspect this would be much simpler the declarative way qdevs norma= lly >> > use. For an example, check out scsi_hd_properties[] and its use in >> > hw/scsi-disk.c. > [snip] >=20 > For static properties bool support was missing some time ago... There are bitfields, which are really the same thing except they expect an u32 field. Paolo