mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 14:00:58 +00:00
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) Backports commit 75158ebbe259f0bd8bf435e8f4827a43ec89c877 from qemu
This commit is contained in:
parent
c749554a75
commit
349447b324
|
@ -77,9 +77,6 @@ void qerror_report_err(Error *err);
|
|||
#define QERR_DEVICE_NOT_ENCRYPTED \
|
||||
ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not encrypted"
|
||||
|
||||
#define QERR_DEVICE_NOT_FOUND \
|
||||
ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found"
|
||||
|
||||
#define QERR_FD_NOT_FOUND \
|
||||
ERROR_CLASS_GENERIC_ERROR, "File descriptor named '%s' not found"
|
||||
|
||||
|
|
|
@ -882,7 +882,8 @@ Object *object_property_get_link(struct uc_struct *uc, Object *obj, const char *
|
|||
if (str && *str) {
|
||||
target = object_resolve_path(uc, 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1097,7 +1098,8 @@ static Object *object_resolve_link(struct uc_struct *uc, Object *obj, const char
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue