qtest: Improve error messages when property can not be set right now
commit8d095933148a0a88ecf1b6bccbbe4ce6c248e2cd
authorMarkus Armbruster <armbru@redhat.com>
Wed, 12 Oct 2022 15:38:00 +0000 (12 17:38 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 27 Oct 2022 05:57:09 +0000 (27 07:57 +0200)
tree9f9fee825977d836a86ac7cb7b81b4993fa8bae4
parentff924448849f4fca48df15ecad67dc93854392e5
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>
softmmu/qtest.c