mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
qerror: Clean up QERR_ macros to expand into a single string
These macros expand into error class enumeration constant, comma,
string. Unclean. Has been that way since commit 13f59ae
.
The error class is always ERROR_CLASS_GENERIC_ERROR since the previous
commit.
Clean up as follows:
* Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and
delete it from the QERR_ macro. No change after preprocessing.
* Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into
error_setg(...). Again, no change after preprocessing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
75158ebbe2
commit
c6bd8c706a
54 changed files with 367 additions and 363 deletions
|
@ -570,8 +570,8 @@ static void set_pci_devfn(Object *obj, Visitor *v, void *opaque,
|
|||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
} else if (value < -1 || value > 255) {
|
||||
error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",
|
||||
"pci_devfn");
|
||||
error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
|
||||
name ? name : "null", "pci_devfn");
|
||||
} else {
|
||||
*ptr = value;
|
||||
}
|
||||
|
@ -640,8 +640,8 @@ static void set_blocksize(Object *obj, Visitor *v, void *opaque,
|
|||
}
|
||||
/* value of 0 means "unset" */
|
||||
if (value && (value < min || value > max)) {
|
||||
error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,
|
||||
dev->id?:"", name, (int64_t)value, min, max);
|
||||
error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,
|
||||
dev->id ? : "", name, (int64_t)value, min, max);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -923,8 +923,8 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
|
|||
break;
|
||||
default:
|
||||
case -EINVAL:
|
||||
error_set(errp, QERR_PROPERTY_VALUE_BAD,
|
||||
object_get_typename(OBJECT(dev)), prop->name, value);
|
||||
error_setg(errp, QERR_PROPERTY_VALUE_BAD,
|
||||
object_get_typename(OBJECT(dev)), prop->name, value);
|
||||
break;
|
||||
case -ENOENT:
|
||||
error_setg(errp, "Property '%s.%s' can't find value '%s'",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue