qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH v6] qdev: Add support for property type bool


From: Andreas Färber
Subject: Re: [Qemu-trivial] [PATCH v6] qdev: Add support for property type bool
Date: Tue, 24 Jan 2012 18:38:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0

Am 24.01.2012 18:29, schrieb Jan Kiszka:
> On 2012-01-24 18:17, Andreas Färber wrote:
>> From: Andreas Färber <address@hidden>
>>
>> VMState supports the type bool but qdev instead supports bit, backed by
>> uint32_t. Therefore let's add DEFINE_PROP_BOOL() and qdev_prop_set_bool().
>>
>> bool by definition is either true or false. Should the need arise to
>> parse yes/no, on/off, 1/0 or whatever as well, we can still add that at
>> a later point in time.
> 
> To make it a real replacement for PROP_TYPE_BIT, let's use on/off, also
> for printing. Not only programmers may use this interface. ;)

Actually non-programmers are the reason for this: cache=on/off makes a
great deal of sense in English (noun), but not enabled=off (adjective),
which was my use case of this patch for ISA devices.

I'm fine with accepting the whole range of possibilities for parsing.
For printing I see no reason to, since there's no legacy users of this
new type we could break. true/false seemed better than yes/no.

>> +PropertyInfo qdev_prop_bool = {
>> +    .name = "bool",
> 
> Now we have "bool" and "boolean". Can we rename the latter to bit?

I'd be fine with that, just don't know if that would break anything
elsewhere for qdev or QOM?

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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