Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Ashijeet Acharya
On Mon, Oct 17, 2016 at 9:29 PM, Eric Blake wrote: > On 10/17/2016 10:44 AM, Ashijeet Acharya wrote: > >> >> I think, its better to keep using atoi() and check if it returns a '0' > > Please not atoi(), as it lacks sane error checking. It cannot tell the > difference between '1' and '1garbage'. I

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Eric Blake
On 10/17/2016 10:44 AM, Ashijeet Acharya wrote: > > I think, its better to keep using atoi() and check if it returns a '0' Please not atoi(), as it lacks sane error checking. It cannot tell the difference between '1' and '1garbage'. It's obvious that you want to treat both '0' and 'name' as an

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Ashijeet Acharya
On Mon, Oct 17, 2016 at 9:23 PM, Kevin Wolf wrote: > Am 17.10.2016 um 17:44 hat Ashijeet Acharya geschrieben: >> On Mon, Oct 17, 2016 at 6:27 PM, Kevin Wolf wrote: >> > Am 17.10.2016 um 14:33 hat Ashijeet Acharya geschrieben: >> >> On Sun, Oct 16, 2016 at 4:00 AM, Max Reitz wrote: >> >> > On 15.

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Kevin Wolf
Am 17.10.2016 um 17:44 hat Ashijeet Acharya geschrieben: > On Mon, Oct 17, 2016 at 6:27 PM, Kevin Wolf wrote: > > Am 17.10.2016 um 14:33 hat Ashijeet Acharya geschrieben: > >> On Sun, Oct 16, 2016 at 4:00 AM, Max Reitz wrote: > >> > On 15.10.2016 11:04, Ashijeet Acharya wrote: > >> >> Add InetSoc

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Ashijeet Acharya
On Mon, Oct 17, 2016 at 6:27 PM, Kevin Wolf wrote: > Am 17.10.2016 um 14:33 hat Ashijeet Acharya geschrieben: >> On Sun, Oct 16, 2016 at 4:00 AM, Max Reitz wrote: >> > On 15.10.2016 11:04, Ashijeet Acharya wrote: >> >> Add InetSocketAddress compatibility to SSH driver. >> >> >> >> Add a new optio

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Kevin Wolf
Am 17.10.2016 um 14:33 hat Ashijeet Acharya geschrieben: > On Sun, Oct 16, 2016 at 4:00 AM, Max Reitz wrote: > > On 15.10.2016 11:04, Ashijeet Acharya wrote: > >> Add InetSocketAddress compatibility to SSH driver. > >> > >> Add a new option "server" to the SSH block driver which then accepts > >>

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Ashijeet Acharya
On Sun, Oct 16, 2016 at 4:00 AM, Max Reitz wrote: > On 15.10.2016 11:04, Ashijeet Acharya wrote: >> Add InetSocketAddress compatibility to SSH driver. >> >> Add a new option "server" to the SSH block driver which then accepts >> a InetSocketAddress. >> >> "host" and "port" are supported as legacy

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Kevin Wolf
Am 16.10.2016 um 00:30 hat Max Reitz geschrieben: > > +static InetSocketAddress *ssh_config(BDRVSSHState *s, QDict *options, > > + Error **errp) > > +{ > > +InetSocketAddress *inet = NULL; > > +QDict *addr = NULL; > > +QObject *crumpled_addr = NULL; >

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-16 Thread Ashijeet Acharya
>>> /* Check the remote host's key against known_hosts. */ >>> -ret = check_host_key(s, host, port, host_key_check, errp); >>> +ret = check_host_key(s, s->inet->host, port, host_key_check, >> >> But then you're still using the port here... And I can't come up with a >> way (not even a

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-16 Thread Ashijeet Acharya
On Sun, Oct 16, 2016 at 4:00 AM, Max Reitz wrote: > On 15.10.2016 11:04, Ashijeet Acharya wrote: >> Add InetSocketAddress compatibility to SSH driver. >> >> Add a new option "server" to the SSH block driver which then accepts >> a InetSocketAddress. >> >> "host" and "port" are supported as legacy

Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-15 Thread Max Reitz
On 15.10.2016 11:04, Ashijeet Acharya wrote: > Add InetSocketAddress compatibility to SSH driver. > > Add a new option "server" to the SSH block driver which then accepts > a InetSocketAddress. > > "host" and "port" are supported as legacy options and are mapped to > their InetSocketAddress repre

[Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-15 Thread Ashijeet Acharya
Add InetSocketAddress compatibility to SSH driver. Add a new option "server" to the SSH block driver which then accepts a InetSocketAddress. "host" and "port" are supported as legacy options and are mapped to their InetSocketAddress representation. Signed-off-by: Ashijeet Acharya --- block/ssh