qemu-devel
[Top][All Lists]
Advanced

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

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


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH v6] qdev: Add support for property type bool
Date: Tue, 24 Jan 2012 11:59:13 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 01/24/2012 11:38 AM, Andreas Färber wrote:
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?

Nothing breaks. Legacy properties (yes, these are legacy) will stick around until we stabilize the QOM public interface.

I think that's probably 2.0 material.

Regards,

Anthony Liguori


Andreas





reply via email to

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