aboutsummaryrefslogtreecommitdiff
path: root/include/hw/qdev-core.h
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2016-06-15 16:08:06 -0300
committerEduardo Habkost <ehabkost@redhat.com>2016-07-07 15:24:52 -0300
commit77280adbdf308af855844d921e5f16a873840568 (patch)
tree03bc6680d5583bcc0f91a87821d58acc8d121090 /include/hw/qdev-core.h
parent8d76bfe8f8dbc7995bc0682d14f5f92583ae5b0a (diff)
qdev: GlobalProperty.errp field
The new field will allow error handling to be configured by qdev_prop_register_global() callers: &error_fatal and &error_abort can be used to make QEMU exit or abort if any errors are reported when applying the properties. While doing it, change the error message from "global %s.%s=%s ignored" to "can't apply global %s.%s=%s". Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/qdev-core.h')
-rw-r--r--include/hw/qdev-core.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 24aa0a7949..1d1f8612a9 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -259,6 +259,9 @@ struct PropertyInfo {
* @user_provided: Set to true if property comes from user-provided config
* (command-line or config file).
* @used: Set to true if property was used when initializing a device.
+ * @errp: Error destination, used like first argument of error_setg()
+ * in case property setting fails later. If @errp is NULL, we
+ * print warnings instead of ignoring errors silently.
*/
typedef struct GlobalProperty {
const char *driver;
@@ -266,6 +269,7 @@ typedef struct GlobalProperty {
const char *value;
bool user_provided;
bool used;
+ Error **errp;
} GlobalProperty;
/*** Board API. This should go away once we have a machine config file. ***/