Skip to content

Commit

Permalink
nbd: don't change socket block during negotiate
Browse files Browse the repository at this point in the history
The caller might handle non-blocking using coroutine. Leave the choice
to the caller to use a blocking or non-blocking negotiate.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
elmarco authored and kraxel committed Dec 16, 2013
1 parent 2302c1c commit e53a18e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions block/nbd-client.c
Expand Up @@ -348,6 +348,7 @@ int nbd_client_session_init(NbdClientSession *client,
int ret;

/* NBD handshake */
qemu_set_block(sock);
ret = nbd_receive_negotiate(sock, client->export_name,
&client->nbdflags, &client->size,
&client->blocksize);
Expand Down
2 changes: 0 additions & 2 deletions nbd.c
Expand Up @@ -443,7 +443,6 @@ int nbd_receive_negotiate(int csock, const char *name, uint32_t *flags,

TRACE("Receiving negotiation.");

qemu_set_block(csock);
rc = -EINVAL;

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

fail:
qemu_set_nonblock(csock);
return rc;
}

Expand Down

0 comments on commit e53a18e

Please sign in to comment.