Il 31/07/2012 14:19, Andreas Färber ha scritto:
>>> >> + sd->spi = false;
>>> >> + object_property_add(obj, "spi", "boolean", sd_is_spi,
>>> >> sd_set_spimode,
>>> >> + NULL, NULL, NULL);
>>> >> +}
>>> >> +
>>> >> static const TypeInfo sd_type_info = {
>>> >> .name = TYPE_SD_CARD,
>>> >> .parent = TYPE_OBJECT,
>>> >> .instance_size = sizeof(SDState),
>>> >> + .instance_init = sd_initfn,
>>> >> .class_init = sd_class_init,
>>> >> .class_size = sizeof(SDClass)
>>> >> };
>> >
>> > I suspect this would be much simpler the declarative way qdevs normally
>> > use. For an example, check out scsi_hd_properties[] and its use in
>> > hw/scsi-disk.c.
> [snip]
>
> 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