On Sat, Oct 8, 2016 at 4:24 PM, Richard W.M. Jones <rjo...@redhat.com> wrote: > On Sat, Oct 08, 2016 at 04:14:06PM +0530, Ashijeet Acharya wrote: >> Introduce new object 'BlockdevOptionsSsh' in qapi/block-core.json to >> support blockdev-add for SSH network protocol driver. Use only 'struct >> InetSocketAddress' since SSH only supports connection over TCP. >> >> +## >> +# @BlockdevoptionsSsh >> +# >> +# @server: host address and port number >> +# >> +# @path: path to the image on the host >> +# >> +# @user: user as which to connect >> +# >> +# @host_key_check defines how and what to check the host key against >> +# >> +# Since 2.8 >> +## >> +{ 'struct': 'BlockdevoptionsSsh', >> + 'data': { 'server': 'InetSocketAddress', >> + 'path': 'str', >> + 'user': 'str', >> + 'host_key_check': 'str' } } >> + > > This certainly reflects the current ssh settings. > > If you really wanted to get into the down-and-dirty details, then > host_key_check has some structure. "yes", "no", "sha1:..." and > others. But probably we don't want all of that in the JSON.
Yeah, JSON only requires the 'host_key_check' option of string datatype and the input from the user automatically gets checked using the ssh driver later I guess. Although, I think we might also need to put a check on condition that port can only be used with a host in ssh.c, like: if (qdict_haskey(options, "port") && !qdict_haskey(options, "host")) { error_setg(errp, "port can only be used with host."); } Ashijeet > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > libguestfs lets you edit virtual machines. Supports shell scripting, > bindings from many languages. http://libguestfs.org