From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF5ft-00033l-Ux for qemu-devel@nongnu.org; Mon, 11 Mar 2013 12:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UF5fn-0007V6-6g for qemu-devel@nongnu.org; Mon, 11 Mar 2013 12:34:09 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:54394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF5fn-0007Uv-1h for qemu-devel@nongnu.org; Mon, 11 Mar 2013 12:34:03 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Mar 2013 12:34:02 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 91B8C6E8063 for ; Mon, 11 Mar 2013 12:33:52 -0400 (EDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2BGXrOl102988 for ; Mon, 11 Mar 2013 12:33:53 -0400 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2BGa36J020809 for ; Mon, 11 Mar 2013 10:36:03 -0600 Message-ID: <513E0716.6020901@linux.vnet.ibm.com> Date: Mon, 11 Mar 2013 12:32:22 -0400 From: "Michael R. Hines" 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> <513DE395.2040906@redhat.com> In-Reply-To: <513DE395.2040906@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed 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: Paolo Bonzini Cc: aliguori@us.ibm.com, mst@redhat.com, michael.r.hines.mrhines@linux.vnet.ibm.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com acknowledged.... On 03/11/2013 10:00 AM, Paolo Bonzini wrote: > 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 >