Re: [Qemu-block] [PATCH v3 5/5] qapi: allow blockdev-add for ssh
On 10/17/2016 12:32 PM, 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. > > Signed-off-by: Ashijeet Acharya> --- > qapi/block-core.json | 26 -- > 1 file changed, 24 insertions(+), 2 deletions(-) > > +++ b/qapi/block-core.json > @@ -1716,7 +1716,8 @@ > 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom', > 'host_device', 'http', 'https', 'luks', 'null-aio', 'null-co', > 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', > - 'replication', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } > +'replication', 'ssh', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', > +'vvfat' ] } Please update the comment just before the enum that mentions 'ssh' as an addition in 2.8. > +## > +# @BlockdevOptionsSsh > +# > +# @server: host address > +# > +# @path:path to the image on the host > +# > +# @user:#optional user as which to connect, defaults to > current > +# local user name > +# > +# @host_key_check #optional defines how and what to check the host > +# key against, defaults to "yes" Please s/host_key_check/host-key-check/ - new interfaces should favor dash, not underscore. (The C code will be the same, though.) > +# > +# Since 2.8 > +## > +{ 'struct': 'BlockdevOptionsSsh', > + 'data': { 'server': 'InetSocketAddress', > +'path': 'str', > +'*user': 'str', > +'*host_key_check': 'str' } } Is host-key-check truly a free-form string, or is it only a finite set of valid possibilities, where 'yes' is the default string? Would it be better to express it as an enum instead of a raw string? -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
[Qemu-block] [PATCH v3 5/5] qapi: allow blockdev-add for ssh
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. Signed-off-by: Ashijeet Acharya--- qapi/block-core.json | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 9d797b8..689dc0a 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1716,7 +1716,8 @@ 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'luks', 'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', - 'replication', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } +'replication', 'ssh', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', +'vvfat' ] } ## # @BlockdevOptionsFile @@ -1953,6 +1954,27 @@ '*vport': 'int', '*segment': 'str' } } +## +# @BlockdevOptionsSsh +# +# @server: host address +# +# @path:path to the image on the host +# +# @user:#optional user as which to connect, defaults to current +# local user name +# +# @host_key_check #optional defines how and what to check the host +# key against, defaults to "yes" +# +# Since 2.8 +## +{ 'struct': 'BlockdevOptionsSsh', + 'data': { 'server': 'InetSocketAddress', +'path': 'str', +'*user': 'str', +'*host_key_check': 'str' } } + ## # @BlkdebugEvent @@ -2281,7 +2303,7 @@ # TODO rbd: Wait for structured options 'replication':'BlockdevOptionsReplication', # TODO sheepdog: Wait for structured options -# TODO ssh: Should take InetSocketAddress for 'host'? + 'ssh':'BlockdevOptionsSsh', 'tftp': 'BlockdevOptionsCurl', 'vdi':'BlockdevOptionsGenericFormat', 'vhdx': 'BlockdevOptionsGenericFormat', -- 2.6.2