From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0mlQ-0001Yd-6C for qemu-devel@nongnu.org; Thu, 12 May 2016 05:18:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0mlL-0001UZ-Sp for qemu-devel@nongnu.org; Thu, 12 May 2016 05:18:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0mlL-0001U7-NW for qemu-devel@nongnu.org; Thu, 12 May 2016 05:18:31 -0400 Date: Thu, 12 May 2016 10:18:26 +0100 From: "Daniel P. Berrange" Message-ID: <20160512091826.GB23500@redhat.com> Reply-To: "Daniel P. Berrange" References: <1462282457-24574-1-git-send-email-ashijeetacharya@gmail.com> <20160503140114.GA11694@redhat.com> <5728EA66.3040909@gmail.com> <20160504083913.GC31167@redhat.com> <5734485E.2000006@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5734485E.2000006@gmail.com> Subject: Re: [Qemu-devel] [PATCH] Modify net/socket.c to use functions from include/qemu/sockets.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ashi Cc: jasowang@redhat.com, qemu-devel@nongnu.org On Thu, May 12, 2016 at 02:39:50PM +0530, Ashi wrote: > 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 > > > > > > > > > > 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?? It is hard to answer that without you showing what your code conversion currently looks like... Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|