qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Modify net/socket.c to use functions from inclu


From: Ashi
Subject: Re: [Qemu-devel] [PATCH] Modify net/socket.c to use functions from include/qemu/sockets.h
Date: Thu, 12 May 2016 14:39:50 +0530
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On Wednesday 04 May 2016 02:09 PM, Daniel P. Berrange wrote:
On Tue, May 03, 2016 at 11:43:58PM +0530, Ashi wrote:


On Tuesday 03 May 2016 07:31 PM, Daniel P. Berrange wrote:
On Tue, May 03, 2016 at 07:04:17PM +0530, Ashijeet Acharya wrote:
From: Ashijeet <address@hidden>

Replaced connect()/listen()/parse_host_port() in net/socket.c
with inet_connect()/inet_listen/inet_parse() in include/qemu/sockets.h.

If you're going to re-work this, then I think it'd be better to
go straight to using socket_connect() / socket_listen() / socket_parse()
which are QAPI based. The inet_* function should eventually be going
away once everything is using the QAPI based socket_* functions, so
adding more usage of them is not too desirable.


Yeah sure I can do that. Also I was wondering if there is a similar function
for bind because the task listed on wiki BiteSized also expects replacement
of bind(). So maybe adding/defining socket_bind() in util/qemu-sockets.c and
the header include/qemu/sockets.h be helpful.

bind() is done automatically as part of the socket_listen() function

Well, I have completed replacing all the older functions with new QAPI based socket_*() ones. Although I am stuck at a part which uses snprintf() in net_socket_connect_init() function (line no. 605). The inet_ntoa() and ntohs() used in snprintf() are really bugging me as I am not sure how to use them with the new SocketAddress type sockets. The code compiles without snprintf() but I am not sure what effect does it have as a whole to abort snprintf(). I am not sure what to do with that??

Thanks!
Ashijeet

Regards,
Daniel




reply via email to

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