qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] qom: Introduce object_class_property_deprecate()
@ 2023-01-09 22:54 Philippe Mathieu-Daudé
  2023-01-09 22:54 ` [RFC PATCH 1/4] " Philippe Mathieu-Daudé
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-01-09 22:54 UTC (permalink / raw)
  To: qemu-devel, Eduardo Habkost, Markus Armbruster,
	Daniel P . Berrange
  Cc: Philippe Mathieu-Daudé, Thomas Huth, Stefan Hajnoczi,
	Kevin Wolf, qemu-block, Paolo Bonzini, Hanna Reitz

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).

Output example:

$ qemu-system-arm -M musicpal,accel=qtest -S \
  -drive if=pflash,driver=null-co,read-zeroes=on,size=8M \
  -global driver=cfi.pflash02,property=width,value=2
qemu-system-arm: warning: Property 'cfi.pflash02.width' is deprecated (renamed as 'cfi.pflash02.device-width').

$ qemu-system-arm -M musicpal,accel=qtest -S \
  -drive if=pflash,driver=null-co,read-zeroes=on,size=8M \
  -global driver=cfi.pflash02,property=device-width,value=2
qemu-system-arm: warning: Property 'cfi.pflash02.width' has been deprecated in release v8.0 and can be removed.

Thought?

Regards,

Phil.

[earlier inspiration: https://lore.kernel.org/qemu-devel/Y7wlnqwU+/auE0Jj@redhat.com/]

Philippe Mathieu-Daudé (4):
  qom: Introduce object_class_property_deprecate()
  hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width'
  util: Introduce helpers to compare QEMU versions
  qom: Warn when deprecated class property can be removed

 hw/block/pflash_cfi02.c     |  8 +++++++-
 include/qemu/qemu-version.h | 36 ++++++++++++++++++++++++++++++++++++
 include/qom/object.h        | 17 +++++++++++++++++
 qom/object.c                | 30 ++++++++++++++++++++++++++++++
 util/meson.build            |  1 +
 util/qemu-version.c         | 37 +++++++++++++++++++++++++++++++++++++
 6 files changed, 128 insertions(+), 1 deletion(-)
 create mode 100644 include/qemu/qemu-version.h
 create mode 100644 util/qemu-version.c

-- 
2.38.1



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-01-11 13:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-09 22:54 [RFC PATCH 0/4] qom: Introduce object_class_property_deprecate() Philippe Mathieu-Daudé
2023-01-09 22:54 ` [RFC PATCH 1/4] " Philippe Mathieu-Daudé
2023-01-10  9:52   ` Daniel P. Berrangé
2023-01-10  9:55   ` Daniel P. Berrangé
2023-01-09 22:54 ` [RFC PATCH 2/4] hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width' Philippe Mathieu-Daudé
2023-01-10  9:50   ` Daniel P. Berrangé
2023-01-09 22:54 ` [RFC PATCH 3/4] util: Introduce helpers to compare QEMU versions Philippe Mathieu-Daudé
2023-01-09 22:54 ` [RFC PATCH 4/4] qom: Warn when deprecated class property can be removed Philippe Mathieu-Daudé
2023-01-10  9:34   ` Bernhard Beschow
2023-01-10  9:49   ` Daniel P. Berrangé
2023-01-10 13:02 ` [RFC PATCH 0/4] qom: Introduce object_class_property_deprecate() Kevin Wolf
2023-01-11  9:55   ` Philippe Mathieu-Daudé
2023-01-11  9:59     ` Daniel P. Berrangé
2023-01-11 10:08       ` Philippe Mathieu-Daudé
2023-01-11 10:29         ` Daniel P. Berrangé
2023-01-11 11:29           ` Markus Armbruster
2023-01-11 13:15             ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).