computing-offload/generic_vdpa/qemu/ui-qmp-cmds-Improve-two-error-messages.patch
jiangdongxu 79c4324644 add generic_vdpa basecode
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
2024-09-19 17:19:46 +08:00

69 lines
2.3 KiB
Diff

From 0425d773b3fa0da62be489ae6c76d1805f28f388 Mon Sep 17 00:00:00 2001
From: boringandboring <wangjinlei_yewu@cmss.chinamobile.com>
Date: Mon, 27 Nov 2023 15:47:21 +0800
Subject: [PATCH] ui/qmp-cmds: Improve two error messages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
cherry picked from 517b0220efd421acf885eed109571a61e95b192a
set_password with "protocol": "vnc" supports only "connected": "keep".
Any other value is rejected with
Invalid parameter 'connected'
Improve this to
parameter 'connected' must be 'keep' when 'protocol' is 'vnc'
client_migrate_info requires "port" or "tls-port". When both are
missing, it fails with
Parameter 'port/tls-port' is missing
Improve this to
parameter 'port' or 'tls-port' is required
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20231031111059.3407803-5-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: boringandboring <wangjinlei_yewu@cmss.chinamobile.com>
---
monitor/misc.c | 2 +-
monitor/qmp-cmds.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/monitor/misc.c b/monitor/misc.c
index a3a6e47844..25a23e2290 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -397,7 +397,7 @@ void qmp_client_migrate_info(const char *protocol, const char *hostname,
}
if (!has_port && !has_tls_port) {
- error_setg(errp, QERR_MISSING_PARAMETER, "port/tls-port");
+ error_setg(errp, "parameter 'port' or 'tls-port' is required");
return;
}
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index d71beace6a..b44cca8234 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -199,7 +199,8 @@ void qmp_set_password(const char *protocol, const char *password,
} else if (strcmp(protocol, "vnc") == 0) {
if (fail_if_connected || disconnect_if_connected) {
/* vnc supports "connected=keep" only */
- error_setg(errp, QERR_INVALID_PARAMETER, "connected");
+ error_setg(errp, "parameter 'connected' must be 'keep'"
+ " when 'protocol' is 'vnc'");
return;
}
/* Note that setting an empty password will not disable login through
--
2.27.0