On Wed, Aug 25, 2021 at 02:59:06PM +0400, Marc-André Lureau wrote:
> > For HMP, this is a bit trickier, since at least 'set_password' already
> > has the 'connected' parameter following the mandatory 'password' one, so
> > we need to prefix the display ID with "id=" to allow correct parsing.
> >
> 
> It's not something done with other commands afaik, feels a bit awkward (the
> "connected = display"...).
> 
> Is it really necessary to add support for HMP?

What's more, we have explicitly documented that HMP is not stable.  We
don't need to bend over backwards to keep old HMP command lines
working if it is saner to just rearrange the command to our new
liking.  You could also supply the display via a flag argument
(set_password -d vnc2 password) instead of trying to place it in a
positional argument.

> > +++ b/hmp-commands.hx
> > @@ -1541,34 +1541,36 @@ ERST
> >
> >      {
> >          .name       = "set_password",
> > -        .args_type  = "protocol:s,password:s,connected:s?",
> > -        .params     = "protocol password action-if-connected",
> > +        .args_type  = "protocol:s,password:s,display:s?,connected:s?",
> > +        .params     = "protocol password [id=display]
> > [action-if-connected]",
> >          .help       = "set spice/vnc password",
> >          .cmd        = hmp_set_password,
> >      },
> >
> >  SRST
> > -``set_password [ vnc | spice ] password [ action-if-connected ]``
> > -  Change spice/vnc password.  Use zero to make the password stay valid
> > -  forever.  *action-if-connected* specifies what should happen in
> > +``set_password [ vnc | spice ] password [ id=display ] [
> > action-if-connected ]``
> > +  Change spice/vnc password.  *display* (must be prefixed with
> > +  'id=') can be used with 'vnc' to specify which display to set the
> > +  password on.  *action-if-connected* specifies what should happen in
> >    case a connection is established: *fail* makes the password change
> > -  fail.  *disconnect* changes the password and disconnects the
> > -  client.  *keep* changes the password and keeps the connection up.
> > -  *keep* is the default.
> > +  fail.  *disconnect* changes the password and disconnects the client.
> > +  *keep* changes the password and keeps the connection up.  *keep* is
> > +  the default.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


Reply via email to