qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] qapi: allow blockdev-add for ssh


From: Ashijeet Acharya
Subject: Re: [Qemu-block] [PATCH] qapi: allow blockdev-add for ssh
Date: Mon, 10 Oct 2016 16:18:25 +0530

On Mon, Oct 10, 2016 at 2:45 PM, Kevin Wolf <address@hidden> wrote:
> 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 <address@hidden>
>> ---
>>  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.

Ohh, maybe I misunderstood. I will update the c code too.
One question though, here when we talk about server, we refer to something like
         <host>:<port>
right? And similarly, maybe not related to this but when we parse uri
using 'uri_parse(filename)', does the 'uri->server' stores a similar
kind of format I mentioned above?

>
> As for how to use a SocketAddress in order to establish a connection,
> you can look at block/nbd.c for reference.

Great! I will use that as a reference.

Ashijeet
>
> Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]