aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-03-17 11:54:50 +0100
committerMarkus Armbruster <armbru@redhat.com>2015-06-22 18:20:40 +0200
commitc6bd8c706a799eb0fece99f468aaa22b818036f3 (patch)
treef6f5c9119c642fee35cdd98957c3bfd30527a76d /qom
parent75158ebbe259f0bd8bf435e8f4827a43ec89c877 (diff)
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>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/qom/object.c b/qom/object.c
index 5dcb8214e6..eea8edf3d3 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -926,7 +926,7 @@ void object_property_get(Object *obj, Visitor *v, const char *name,
}
if (!prop->get) {
- error_set(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, QERR_PERMISSION_DENIED);
} else {
prop->get(obj, v, prop->opaque, name, errp);
}
@@ -941,7 +941,7 @@ void object_property_set(Object *obj, Visitor *v, const char *name,
}
if (!prop->set) {
- error_set(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, QERR_PERMISSION_DENIED);
} else {
prop->set(obj, v, prop->opaque, name, errp);
}
@@ -968,7 +968,7 @@ char *object_property_get_str(Object *obj, const char *name,
}
qstring = qobject_to_qstring(ret);
if (!qstring) {
- error_set(errp, QERR_INVALID_PARAMETER_TYPE, name, "string");
+ error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "string");
retval = NULL;
} else {
retval = g_strdup(qstring_get_str(qstring));
@@ -1029,7 +1029,7 @@ bool object_property_get_bool(Object *obj, const char *name,
}
qbool = qobject_to_qbool(ret);
if (!qbool) {
- error_set(errp, QERR_INVALID_PARAMETER_TYPE, name, "boolean");
+ error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "boolean");
retval = false;
} else {
retval = qbool_get_bool(qbool);
@@ -1060,7 +1060,7 @@ int64_t object_property_get_int(Object *obj, const char *name,
}
qint = qobject_to_qint(ret);
if (!qint) {
- error_set(errp, QERR_INVALID_PARAMETER_TYPE, name, "int");
+ error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "int");
retval = -1;
} else {
retval = qint_get_int(qint);
@@ -1304,7 +1304,7 @@ static Object *object_resolve_link(Object *obj, const char *name,
} else if (!target) {
target = object_resolve_path(path, &ambiguous);
if (target || ambiguous) {
- error_set(errp, QERR_INVALID_PARAMETER_TYPE, name, target_type);
+ error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, target_type);
} else {
error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
"Device '%s' not found", path);