From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF3I2-0005A3-QJ for qemu-devel@nongnu.org; Mon, 11 Mar 2013 10:01:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UF3Hx-0001cg-Rt for qemu-devel@nongnu.org; Mon, 11 Mar 2013 10:01:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF3Hx-0001cN-Ir for qemu-devel@nongnu.org; Mon, 11 Mar 2013 10:01:17 -0400 Message-ID: <513DE395.2040906@redhat.com> Date: Mon, 11 Mar 2013 15:00:53 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1362976414-21396-1-git-send-email-mrhines@us.ibm.com> <1362976414-21396-11-git-send-email-mrhines@us.ibm.com> In-Reply-To: <1362976414-21396-11-git-send-email-mrhines@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH RDMA support v3: 10/10] Parse RDMA host/port out of the QMP string. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael.R.Hines.mrhines@linux.vnet.ibm.com Cc: aliguori@us.ibm.com, mst@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com Il 11/03/2013 05:33, Michael.R.Hines.mrhines@linux.vnet.ibm.com ha scritto: > From: "Michael R. Hines" > > ... want to use existing functions to do this. Remember that each of the 10 steps should compile and link, both with and without librdmacm installed. So this should be quite earlier. > Signed-off-by: Michael R. Hines > --- > include/qemu/sockets.h | 1 + > util/oslib-posix.c | 4 ++++ > util/qemu-sockets.c | 2 +- > 3 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h > index 6125bf7..86fe4da 100644 > --- a/include/qemu/sockets.h > +++ b/include/qemu/sockets.h > @@ -47,6 +47,7 @@ typedef void NonBlockingConnectHandler(int fd, void *opaque); > int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp); > int inet_listen(const char *str, char *ostr, int olen, > int socktype, int port_offset, Error **errp); > +InetSocketAddress *inet_parse(const char *str, Error **errp); > int inet_connect_opts(QemuOpts *opts, Error **errp, > NonBlockingConnectHandler *callback, void *opaque); > int inet_connect(const char *str, Error **errp); > diff --git a/util/oslib-posix.c b/util/oslib-posix.c > index 433dd68..dc369ae 100644 > --- a/util/oslib-posix.c > +++ b/util/oslib-posix.c > @@ -137,6 +137,8 @@ void qemu_vfree(void *ptr) > void socket_set_block(int fd) > { > int f; > + if(fd < 0) > + return; What is this needed for? Make it a separate patch and describe the rationale in the commit message. > f = fcntl(fd, F_GETFL); > fcntl(fd, F_SETFL, f & ~O_NONBLOCK); > } > @@ -144,6 +146,8 @@ void socket_set_block(int fd) > void socket_set_nonblock(int fd) > { > int f; > + if(fd < 0) > + return; > f = fcntl(fd, F_GETFL); > fcntl(fd, F_SETFL, f | O_NONBLOCK); > } > diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c > index 3f12296..58e4bcd 100644 > --- a/util/qemu-sockets.c > +++ b/util/qemu-sockets.c > @@ -485,7 +485,7 @@ err: > } > > /* compatibility wrapper */ > -static InetSocketAddress *inet_parse(const char *str, Error **errp) > +InetSocketAddress *inet_parse(const char *str, Error **errp) > { > InetSocketAddress *addr; > const char *optstr, *h; > Paolo