@@ -225,6 +225,8 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj,
*/
void qdev_property_add_static(DeviceState *dev, Property *prop);
+void qdev_property_del_static(DeviceState *dev, Property *prop);
+
/**
* qdev_alias_all_properties: Create aliases on source for all target properties
* @target: Device which has properties to be aliased
@@ -994,6 +994,13 @@ void qdev_property_add_static(DeviceState *dev, Property *prop)
}
}
+void qdev_property_del_static(DeviceState *dev, Property *prop)
+{
+ Object *obj = OBJECT(dev);
+
+ object_property_del(obj, prop->name);
+}
+
static void qdev_class_add_property(DeviceClass *klass, const char *name,
Property *prop)
{
We can add properties with qdev_property_add_static(). Add qdev_property_del_static() to delete them. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/hw/qdev-properties.h | 2 ++ hw/core/qdev-properties.c | 7 +++++++ 2 files changed, 9 insertions(+)