Skip to content

RFC qom: Introduce object_class_property_deprecate()

Philippe Mathieu-Daudé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4qom: Introduce object_class_property_deprecate()include/qom/object.h qom/object.c+40 -02 replies
2/4hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width'hw/block/pflash_cfi02.c+7 -11 reply
3/4util: Introduce helpers to compare QEMU versionsinclude/qemu/qemu-version.h util/meson.build util/qemu-version.c+74 -00 replies
4/4qom: Warn when deprecated class property can be removedqom/object.c+7 -02 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by.

PatchDaniel P. Berrange
1/4Inspired-by
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/4] qom: Introduce object_class_property_deprecate()

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+/[email protected]/]

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
Signature · 1 line
2.38.1