Am 09.06.2011 um 16:45 schrieb Markus Armbruster:
Andreas Färber <andreas.faer...@web.de> writes:
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().
Since, e.g., enabled=on does not look nice, parse/print "yes" and
"no".
The difference between bool and bit properties is implementation
detail.
Using "on/off" for one, and "yes/no" for the other is a gratuitously
inconsistent user interface.
For what it's worth, "on" doesn't look nice for many bit properties
either.
Options:
1. Live with the inconsistent user interface
1. Stick to on/off ugly or not
3. Switch to yes/no and deprecate on/off
Opinions?
It would certainly be possible to support all of on/off, yes/no, true/
false, 1/0 in the two parsing methods. Independent of any
implementation detail.
My reasoning was that grammatically, using on/off with a noun in just
fine, e.g., cache=off.
With an adjective however, it's wrong. Therefore my choice of yes/no
here.
Juan, what did you think of?
Andreas