mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
8d76bfe8f8
commit
77280adbdf
2 changed files with 12 additions and 3 deletions
|
@ -1085,9 +1085,14 @@ static void qdev_prop_set_globals_for_type(DeviceState *dev,
|
|||
prop->used = true;
|
||||
object_property_parse(OBJECT(dev), prop->value, prop->property, &err);
|
||||
if (err != NULL) {
|
||||
assert(prop->user_provided);
|
||||
error_reportf_err(err, "Warning: global %s.%s=%s ignored: ",
|
||||
prop->driver, prop->property, prop->value);
|
||||
error_prepend(&err, "can't apply global %s.%s=%s: ",
|
||||
prop->driver, prop->property, prop->value);
|
||||
if (prop->errp) {
|
||||
error_propagate(prop->errp, err);
|
||||
} else {
|
||||
assert(prop->user_provided);
|
||||
error_reportf_err(err, "Warning: ");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue