qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH RDMA support v3: 10/10] Parse RDMA host/port


From: Michael R. Hines
Subject: Re: [Qemu-devel] [RFC PATCH RDMA support v3: 10/10] Parse RDMA host/port out of the QMP string.
Date: Mon, 11 Mar 2013 12:32:22 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

acknowledged....

On 03/11/2013 10:00 AM, Paolo Bonzini wrote:
Il 11/03/2013 05:33, address@hidden ha scritto:
From: "Michael R. Hines" <address@hidden>

... 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 <address@hidden>
---
  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





reply via email to

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