Commit 162cbbd1 authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Stefan Hajnoczi
# Via Luiz Capitulino
* luiz/queue/qmp:
  chardev: clear O_NONBLOCK on SCM_RIGHTS file descriptors
  qemu-socket: set passed fd non-blocking in socket_connect()
  net: ensure "socket" backend uses non-blocking fds
  oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()
parents 9d4563c4 9b938c72
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ static int nbd_establish_connection(BlockDriverState *bs)

    /* Now that we're connected, set the socket to be non-blocking and
     * kick the reply mechanism.  */
    socket_set_nonblock(sock);
    qemu_set_nonblock(sock);
    qemu_aio_set_fd_handler(sock, nbd_reply_ready, NULL,
                            nbd_have_request, s);

+1 −1
Original line number Diff line number Diff line
@@ -471,7 +471,7 @@ static int connect_to_sdog(BDRVSheepdogState *s)
        qerror_report_err(err);
        error_free(err);
    } else {
        socket_set_nonblock(fd);
        qemu_set_nonblock(fd);
    }

    return fd;
+2 −2
Original line number Diff line number Diff line
@@ -37,8 +37,8 @@ int qemu_socket(int domain, int type, int protocol);
int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
int socket_set_cork(int fd, int v);
int socket_set_nodelay(int fd);
void socket_set_block(int fd);
void socket_set_nonblock(int fd);
void qemu_set_block(int fd);
void qemu_set_nonblock(int fd);
int send_all(int fd, const void *buf, int len1);
int recv_all(int fd, void *buf, int len1, bool single_read);

+1 −1
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ void process_incoming_migration(QEMUFile *f)
    int fd = qemu_get_fd(f);

    assert(fd != -1);
    socket_set_nonblock(fd);
    qemu_set_nonblock(fd);
    qemu_coroutine_enter(co, f);
}

+4 −4
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ static int nbd_send_negotiate(NBDClient *client)
        [28 .. 151]   reserved     (0)
     */

    socket_set_block(csock);
    qemu_set_block(csock);
    rc = -EINVAL;

    TRACE("Beginning negotiation.");
@@ -429,7 +429,7 @@ static int nbd_send_negotiate(NBDClient *client)
    TRACE("Negotiation succeeded.");
    rc = 0;
fail:
    socket_set_nonblock(csock);
    qemu_set_nonblock(csock);
    return rc;
}

@@ -443,7 +443,7 @@ int nbd_receive_negotiate(int csock, const char *name, uint32_t *flags,

    TRACE("Receiving negotiation.");

    socket_set_block(csock);
    qemu_set_block(csock);
    rc = -EINVAL;

    if (read_sync(csock, buf, 8) != 8) {
@@ -558,7 +558,7 @@ int nbd_receive_negotiate(int csock, const char *name, uint32_t *flags,
    rc = 0;

fail:
    socket_set_nonblock(csock);
    qemu_set_nonblock(csock);
    return rc;
}

Loading