qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 01/12] qdev: Add support for property type bo


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v4 01/12] qdev: Add support for property type bool
Date: Sun, 12 Jun 2011 13:44:36 +0200

Am 09.06.2011 um 16:45 schrieb Markus Armbruster:

Andreas Färber <address@hidden> 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


reply via email to

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