aboutsummaryrefslogtreecommitdiff
path: root/authz
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-11-13 07:23:58 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2020-11-18 10:51:35 +0000
commit8e26ae7bb58d10c04599eabd265217da050514a4 (patch)
tree83a086f310851046f12cfd4c23ac69f872724dd8 /authz
parent2b37e9f84372b5c98ef0ba114ce016953e47bc3c (diff)
downloadqemu-8e26ae7bb58d10c04599eabd265217da050514a4.zip
qemu-8e26ae7bb58d10c04599eabd265217da050514a4.tar.gz
qemu-8e26ae7bb58d10c04599eabd265217da050514a4.tar.bz2
authz-list-file: Improve an error message
When qauthz_list_file_load() rejects JSON values other than JSON object with a rather confusing error message: $ echo 1 | qemu-system-x86_64 -nodefaults -S -display none -object authz-list-file,id=authz0,filename=/dev/stdin qemu-system-x86_64: -object authz-list-file,id=authz0,filename=/dev/stdin: Invalid parameter type for 'obj', expected: dict Improve to qemu-system-x86_64: -object authz-list-file,id=authz0,filename=/dev/stdin: File '/dev/stdin' must contain a JSON object Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'authz')
-rw-r--r--authz/listfile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/authz/listfile.c b/authz/listfile.c
index 1421e67..da3a0e6 100644
--- a/authz/listfile.c
+++ b/authz/listfile.c
@@ -73,7 +73,8 @@ qauthz_list_file_load(QAuthZListFile *fauthz, Error **errp)
pdict = qobject_to(QDict, obj);
if (!pdict) {
- error_setg(errp, QERR_INVALID_PARAMETER_TYPE, "obj", "dict");
+ error_setg(errp, "File '%s' must contain a JSON object",
+ fauthz->filename);
goto cleanup;
}