diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2013-03-25 13:40:44 +0000 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-03-26 09:26:49 -0500 |
commit | b000dfbd42e8aac9af66ae0ed787ef1021bea29f (patch) | |
tree | 83208f9f96b6b7b09274173a9b94732112955bc4 /hw/qdev-properties.h | |
parent | c19f806e01ba5c4a4d4fac80b76841512ed4a11e (diff) | |
download | hqemu-b000dfbd42e8aac9af66ae0ed787ef1021bea29f.zip hqemu-b000dfbd42e8aac9af66ae0ed787ef1021bea29f.tar.gz |
hw/qdev-properties.c: Improve diagnostic for setting property after realize
Now we have error_setg() we can improve the error message emitted if
you attempt to set a property of a device after the device is realized
(the previous message was "permission denied" which was not very
informative).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1364218844-7509-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev-properties.h')
-rw-r--r-- | hw/qdev-properties.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/qdev-properties.h b/hw/qdev-properties.h index c9bb246..a379339 100644 --- a/hw/qdev-properties.h +++ b/hw/qdev-properties.h @@ -167,4 +167,16 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, */ void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp); +/** + * @qdev_prop_set_after_realize: + * @dev: device + * @name: name of property + * @errp: indirect pointer to Error to be set + * Set the Error object to report that an attempt was made to set a property + * on a device after it has already been realized. This is a utility function + * which allows property-setter functions to easily report the error in + * a friendly format identifying both the device and the property. + */ +void qdev_prop_set_after_realize(DeviceState *dev, const char *name, + Error **errp); #endif |