On Tue, 10 Feb 2026, Daniel P. Berrangé wrote:
On Tue, Feb 10, 2026 at 05:44:50AM -0500, Michael S. Tsirkin wrote:
On Tue, Feb 10, 2026 at 10:12:38AM +0000, Daniel P. Berrangé wrote:
On Tue, Feb 10, 2026 at 11:23:27AM +0800, Zhao Liu wrote:
Hi,
This is the v2 trying to introduce property flags to detect user's
property setting (from CLI/QMP/HMP). I dropped RFC tag since previous
RFC v1 [1].
This says what the series is proposing, but IMHO what is more important
here is explaining why this either desirable or appropriate to add as
general facility in QOM.
The idea that code should take different action for a given fixed value,
based on whether the value was set by the user, or left on the default,
makes me very uncomfortable.
There have been a number of situations where something that was initially
a boolean flag, actually needed to be a tri-state instead, to provide
semantics like "On", "Off", "Auto".
But "auto" is exactly a property specific way to work around this.
With this, we could allow "auto" for any property (except strings I
guess) without per property code.
This "user set" flag could support such behaviour indirectly, but since
"user set" is an internal concept we'd still be only exposing a boolean
externally, while using a tri-state internally. That does not give the
full flexibility of a tri-state, because internally if we wanted to
have the default to be "yes", it offers no way for the mgmt app to
put it back to "auto".
I do not get it. Of course user set is an external concept.
It is user controllable!
If a property is modelled as a tri-state today the user can explicitly
request any of the three values
-object foo,prop=on
-object foo,prop=off
-object foo,prop=auto
If a property is modelled as a boolean, and we have this new internal
"user set" flag to represent the "auto" scenario, the user can only
do
-object foo,prop=on
-object foo,prop=off
we're missing the ability to explicitly request the "auto" value,
which could be needed if we decide the internal default should be
either "on" or "off".
In this case the auto setting would be not setting the property at all to
any value by the user.
This "user default" flag concept is special casing support for
tri-states in a way that is worse than what we can already do in
QAPI. That feels like a mistake / bad path to go down to me.
I also don't really like the USER_SET name so commented to rename to
EXTERNAL but thinking more do we need both EXTERNAL/USER_SET and INTERNAL?
One of the two would be the default behaviour for untagged properties so
maybe we only need to flag INTERNAL to omit them from introspection and
user setting but don't need to touch normal user settable properties
(apart from adding deprecarion_message that also replaces DEPRECATED flag.
But I don't have clear idea or opinion on this so these are more questions
than suggestions.
Regards,
BALATON Zoltan