Per docs/system/deprecated.rst, a deprecated feature can be
removed after 2 releases. Since we commit when a class property
is deprecated, we can warn when the deprecation period is over.
See also commit ef1f5b0a96 ("docs: clarify deprecation schedule").
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
qom/object.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/qom/object.c b/qom/object.c
index 05b97cd424..cb829f1e44 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -17,6 +17,7 @@
#include "qom/object_interfaces.h"
#include "qemu/cutils.h"
#include "qemu/memalign.h"
+#include "qemu/qemu-version.h"
#include "qapi/visitor.h"
#include "qapi/string-input-visitor.h"
#include "qapi/string-output-visitor.h"
@@ -1300,6 +1301,12 @@ void object_class_property_deprecate(ObjectClass *klass,
ObjectProperty *prop = object_class_property_find(klass, name);
assert(prop);
+ if (qemu_version_delta_current(version_major, version_minor) <= 2) {
+ warn_report_once("Property '%s.%s' has been deprecated in release"
+ " v%u.%u and can be removed.",
+ object_class_get_name(klass), name,
+ version_major, version_minor);
+ }
prop->deprecation_reason = reason;
}
--
2.38.1