From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btWgk-0004pX-OA for qemu-devel@nongnu.org; Mon, 10 Oct 2016 05:16:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btWgj-00076z-Kb for qemu-devel@nongnu.org; Mon, 10 Oct 2016 05:16:02 -0400 Date: Mon, 10 Oct 2016 11:15:52 +0200 From: Kevin Wolf Message-ID: <20161010091552.GC6775@noname.redhat.com> References: <1475923446-29428-1-git-send-email-ashijeetacharya@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1475923446-29428-1-git-send-email-ashijeetacharya@gmail.com> Subject: Re: [Qemu-devel] [PATCH] qapi: allow blockdev-add for ssh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ashijeet Acharya Cc: eblake@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, qemu-block@nongnu.org Am 08.10.2016 um 12:44 hat Ashijeet Acharya geschrieben: > 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 | 24 ++++++++++++++++++++++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 9d797b8..237ec6b 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,25 @@ > '*vport': 'int', > '*segment': 'str' } } > > +## > +# @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' } } Did you test this? The ssh driver currently takes a separate 'host' string and 'port' integer, not a 'server' InetSocketAddress, so I think the C code needs an update, too. As for how to use a SocketAddress in order to establish a connection, you can look at block/nbd.c for reference. Kevin