On 10/1/23 14:02, Kevin Wolf wrote:
Am 09.01.2023 um 23:54 hat Philippe Mathieu-Daudé geschrieben:
Hi,

There will always be a need to deprecate things. Here I'm
tackling the QOM (class) properties, since they can be set
from some CLI options (-object -device -global ...).

As an experiment, we add object_class_property_deprecate()
to register a class property as deprecated (since some version),
then we deprecate the TYPE_PFLASH_CFI02 'width' property, and
finally as a bonus we emit a warning when the deprecation period
is over, as a reminder. (For that we introduce few 'versions'
helpers).

The last part means that increasing the version number (i.e. the commit
that opens the development tree for the next release) can change the
output, and this is turn can break test cases.

If we are happy to introduce breakage with a version number change that
will require future commits to open the development tree less trivial
than they are today because they need to fix the breakage, too, why not
make it a build error instead of a different warning message at runtime?

To avoid build breakages, maybe it is clever is to store the deprecation
version in ObjectPropertyInfo and let QAPI inspection scripts enumerate
/ report deprecated features?

Reply via email to