qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V4 11/12] SD card: introduce "spi" property for


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH V4 11/12] SD card: introduce "spi" property for SD card objects
Date: Tue, 31 Jul 2012 14:53:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]