Skip to content

Commit

Permalink
qapi/monitor: only allow 'keep' SetPasswordAction for VNC and deprecate
Browse files Browse the repository at this point in the history
VNC only supports 'keep' here, enforce this via a seperate
SetPasswordActionVnc enum and mark the option 'deprecated' (as it is
useless with only one value possible).

Also add a deprecation note to docs.

Suggested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Message-Id: <20211021100135.4146766-5-s.reiter@proxmox.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
  • Loading branch information
PiMaker authored and Markus Armbruster committed Oct 28, 2021
1 parent ddf513e commit 47c8493
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
6 changes: 6 additions & 0 deletions docs/about/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ single ``bitmap``, the new ``block-export-add`` uses a list of ``bitmaps``.
Member ``values`` in return value elements with meta-type ``enum`` is
deprecated. Use ``members`` instead.

``set_password`` argument ``connected`` for VNC protocol (since 6.2)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Only the value ``keep`` is and was ever supported for VNC. The (useless)
argument will be dropped in a future version of QEMU.

System accelerators
-------------------

Expand Down
5 changes: 0 additions & 5 deletions monitor/qmp-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,6 @@ void qmp_set_password(SetPasswordOptions *opts, Error **errp)
opts->u.spice.connected == SET_PASSWORD_ACTION_DISCONNECT);
} else {
assert(opts->protocol == DISPLAY_PROTOCOL_VNC);
if (opts->u.vnc.connected != SET_PASSWORD_ACTION_KEEP) {
/* vnc supports "connected=keep" only */
error_setg(errp, QERR_INVALID_PARAMETER, "connected");
return;
}
/* Note that setting an empty password will not disable login through
* this interface. */
rc = vnc_display_password(opts->u.vnc.display, opts->password);
Expand Down
21 changes: 20 additions & 1 deletion qapi/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@
{ 'enum': 'SetPasswordAction',
'data': [ 'fail', 'disconnect', 'keep' ] }

##
# @SetPasswordActionVnc:
#
# See @SetPasswordAction. VNC only supports the keep action. 'connection'
# should just be omitted for VNC, this is kept for backwards compatibility.
#
# @keep: maintain existing clients
#
# Since: 6.2
#
##
{ 'enum': 'SetPasswordActionVnc',
'data': [ 'keep' ] }

##
# @SetPasswordOptions:
#
Expand Down Expand Up @@ -83,12 +97,17 @@
# @connected: How to handle existing clients when changing the
# password.
#
# Features:
# @deprecated: For VNC, @connected will always be 'keep', parameter should be
# omitted.
#
# Since: 6.2
#
##
{ 'struct': 'SetPasswordOptionsVnc',
'data': { '*display': 'str',
'*connected': 'SetPasswordAction' }}
'*connected': { 'type': 'SetPasswordActionVnc',
'features': ['deprecated'] } } }

##
# @set_password:
Expand Down

0 comments on commit 47c8493

Please sign in to comment.