diff options
author | Markus Armbruster | 2022-10-12 17:38:00 +0200 |
---|---|---|
committer | Markus Armbruster | 2022-10-27 07:57:09 +0200 |
commit | 8d095933148a0a88ecf1b6bccbbe4ce6c248e2cd (patch) | |
tree | 9f9fee825977d836a86ac7cb7b81b4993fa8bae4 /softmmu | |
parent | backends: Improve error messages when property can no longer be set (diff) | |
download | qemu-8d095933148a0a88ecf1b6bccbbe4ce6c248e2cd.tar.gz qemu-8d095933148a0a88ecf1b6bccbbe4ce6c248e2cd.tar.xz qemu-8d095933148a0a88ecf1b6bccbbe4ce6c248e2cd.zip |
qtest: Improve error messages when property can not be set right now
When you try to set qtest property "log" while the qtest object is
active, the error message blames "insufficient permission":
$ qemu-system-x86_64 -S -display none -nodefaults -monitor stdio -chardev socket,id=chrqt0,path=qtest.socket,server=on,wait=off -object qtest,id=qt0,chardev=chrqt0,log=/dev/null
QEMU 7.1.50 monitor - type 'help' for more information
(qemu) qom-set /objects/qt0 log qtest.log
Error: Insufficient permission to perform this operation
This implies it could work with "sufficient permission". It can't.
Change the error message to:
Error: Property 'log' can not be set now
Same for property "chardev".
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221012153801.2604340-4-armbru@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/qtest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/softmmu/qtest.c b/softmmu/qtest.c index f8acef2628..afea7693d0 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -977,7 +977,7 @@ static void qtest_set_log(Object *obj, const char *value, Error **errp) QTest *q = QTEST(obj); if (qtest == q) { - error_setg(errp, QERR_PERMISSION_DENIED); + error_setg(errp, "Property 'log' can not be set now"); } else { g_free(q->log); q->log = g_strdup(value); @@ -997,7 +997,7 @@ static void qtest_set_chardev(Object *obj, const char *value, Error **errp) Chardev *chr; if (qtest == q) { - error_setg(errp, QERR_PERMISSION_DENIED); + error_setg(errp, "Property 'chardev' can not be set now"); return; } |