提交 cfa9bb23 编写于 作者: M Markus Armbruster

qmp hmp: Improve error messages when SPICE is not in use

Commit 7572150c adopted QERR_DEVICE_NOT_ACTIVE for the purpose,
probably because adding another error seemed cumbersome overkill.
Produces "No spice device has been activated", which is awkward.

We've since abandoned our quest for "rich" error objects.  Time to
undo the damage to this error message.  Replace it by "SPICE is not in
use".

Keep the stupid DeviceNotActive ErrorClass for compatibility, even
though Libvirt doesn't use it.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
上级 b25d81ba
......@@ -91,8 +91,8 @@ static inline int qemu_spice_display_add_client(int csock, int skipauth,
static inline bool qemu_using_spice(Error **errp)
{
if (!using_spice) {
/* correct one? spice isn't a device ,,, */
error_set(errp, QERR_DEVICE_NOT_ACTIVE, "spice");
error_set(errp, ERROR_CLASS_DEVICE_NOT_ACTIVE,
"SPICE is not in use");
return false;
}
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册