From 75158ebbe259f0bd8bf435e8f4827a43ec89c877 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 16 Mar 2015 08:57:47 +0100 Subject: qerror: Eliminate QERR_DEVICE_NOT_FOUND Error classes other than ERROR_CLASS_GENERIC_ERROR should not be used in new code. Hiding them in QERR_ macros makes new uses hard to spot. Fortunately, there's just one such macro left. Eliminate it with this coccinelle semantic patch: @@ expression EP, E; @@ -error_set(EP, QERR_DEVICE_NOT_FOUND, E) +error_set(EP, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", E) Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Luiz Capitulino --- qom/object.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qom') diff --git a/qom/object.c b/qom/object.c index 7ed17bc..5dcb821 100644 --- a/qom/object.c +++ b/qom/object.c @@ -999,7 +999,8 @@ Object *object_property_get_link(Object *obj, const char *name, if (str && *str) { target = object_resolve_path(str, NULL); if (!target) { - error_set(errp, QERR_DEVICE_NOT_FOUND, str); + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "Device '%s' not found", str); } } @@ -1305,7 +1306,8 @@ static Object *object_resolve_link(Object *obj, const char *name, if (target || ambiguous) { error_set(errp, QERR_INVALID_PARAMETER_TYPE, name, target_type); } else { - error_set(errp, QERR_DEVICE_NOT_FOUND, path); + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "Device '%s' not found", path); } target = NULL; } -- cgit v1.1