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 --- net/net.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'net') diff --git a/net/net.c b/net/net.c index 85c4b20d8f..7b5f519293 100644 --- a/net/net.c +++ b/net/net.c @@ -1127,7 +1127,8 @@ void qmp_netdev_del(const char *id, Error **errp) nc = qemu_find_netdev(id); if (!nc) { - error_set(errp, QERR_DEVICE_NOT_FOUND, id); + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "Device '%s' not found", id); return; } @@ -1238,7 +1239,8 @@ void qmp_set_link(const char *name, bool up, Error **errp) MAX_QUEUE_NUM); if (queues == 0) { - error_set(errp, QERR_DEVICE_NOT_FOUND, name); + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "Device '%s' not found", name); return; } nc = ncs[0]; -- cgit v1.2.3