diff mbox

[03/20] monitor: Improve and document client_migrate_info protocol error

Message ID 1432294585-5984-4-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster May 22, 2015, 11:36 a.m. UTC
Protocol must be spice, vnc isn't implemented.  Fix up documentation.

Attempts to use vnc or any other unknown protocol yield the misleading
error message "Invalid parameter 'protocol'".  Improve it to
"Parameter 'protocol' expects spice".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hmp-commands.hx | 1 +
 monitor.c       | 2 +-
 qmp-commands.hx | 3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)

Comments

Eric Blake May 22, 2015, 9:21 p.m. UTC | #1
On 05/22/2015 05:36 AM, Markus Armbruster wrote:
> Protocol must be spice, vnc isn't implemented.  Fix up documentation.
> 
> Attempts to use vnc or any other unknown protocol yield the misleading
> error message "Invalid parameter 'protocol'".  Improve it to
> "Parameter 'protocol' expects spice".
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hmp-commands.hx | 1 +
>  monitor.c       | 2 +-
>  qmp-commands.hx | 3 ++-
>  3 files changed, 4 insertions(+), 2 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox

Patch

diff --git a/hmp-commands.hx b/hmp-commands.hx
index e864a6c..a8be73a 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1022,6 +1022,7 @@  STEXI
 Set the spice/vnc connection info for the migration target.  The spice/vnc
 server will ask the spice/vnc client to automatically reconnect using the
 new parameters (if specified) once the vm migration finished successfully.
+Not yet implemented for VNC.
 ETEXI
 
     {
diff --git a/monitor.c b/monitor.c
index 5330e61..b507ee3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1063,7 +1063,7 @@  static int client_migrate_info(Monitor *mon, const QDict *qdict,
         return 0;
     }
 
-    qerror_report(QERR_INVALID_PARAMETER, "protocol");
+    qerror_report(QERR_INVALID_PARAMETER_VALUE, "protocol", "spice");
     return -1;
 }
 
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 14e109e..c267c89 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -795,10 +795,11 @@  client_migrate_info
 Set the spice/vnc connection info for the migration target.  The spice/vnc
 server will ask the spice/vnc client to automatically reconnect using the
 new parameters (if specified) once the vm migration finished successfully.
+Not yet implemented for VNC.
 
 Arguments:
 
-- "protocol":     protocol: "spice" or "vnc" (json-string)
+- "protocol":     must be "spice" (json-string)
 - "hostname":     migration target hostname (json-string)
 - "port":         spice/vnc tcp port for plaintext channels (json-int, optional)
 - "tls-port":     spice tcp port for tls-secured channels (json-int, optional)