qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 2/4] qdev-properties: Accept bool for OnOffAuto


From: Akihiko Odaki
Subject: Re: [PATCH v4 2/4] qdev-properties: Accept bool for OnOffAuto
Date: Thu, 8 May 2025 16:09:42 +0900
User-agent: Mozilla Thunderbird

On 2025/05/07 0:37, Markus Armbruster wrote:
Akihiko Odaki <akihiko.odaki@daynix.com> writes:

On 2025/02/06 18:48, Markus Armbruster wrote:
Akihiko Odaki <akihiko.odaki@daynix.com> writes:

[...]

I understand we have something like this:

* true: on if possible, else off

* false: off (always possible)

Which one is the default?

It depends. Some properties have true by default. The others have false.


There is no way to reliably configure "on", i.e. fail if it's not
possible.  I agree that's a problem.

                                              This problem can be solved
using an existing mechanism, OnOffAuto, which differentiates the "auto"
state and explicit the "on" state.

I guess you're proposing something like this:

* auto: on if possible, else off

* on: on if possible, else error

* off: off (always possible)

Which one is the default?

I converted on to auto and off to false in a following patch.


However, converting bool to OnOffAuto surfaces another problem: they
disagree how "on" and "off" should be written. Please note that the
disagreement already exists and so it is nice to solve anyway.

Yes, converting bool to OnOffAuto is an incompatible change.

Not just about conversion, but this inconsistency require users to know
whether a property is bool or OnOffAuto and change how the values are
written in JSON accordingly. This somewhat hurts usability.


This patch tries to solve it by tolerating bool values for OnOffAuto. As
you pointed out, this approach has a downside: it makes OnOffAuto more
complicated by having multiple ways to express the same thing.

It also affects existing uses of OnOffAuto, where such a change is
unnecessary and undesirable.

To be clear: this is pretty much a deal-breaker for me.

We established above that you need certain boolean properties to take a
third state.  I'm willing to discuss patches that change exactly these
properties.  I'm going to reject patches that affect properties that do
not need such a change.

I also want to change the existing OnOffAuto properties while I do want to change certain boolean properties as you read.

For my reasoning to change the existing OnOffAuto properties, please refer to:
d166d6c2-2b52-4c70-8fcf-a12f34a2347e@daynix.com/">https://lore.kernel.org/qemu-devel/d166d6c2-2b52-4c70-8fcf-a12f34a2347e@daynix.com/



reply via email to

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