From 27e5eae4577316f7e86a56eb7363d4e78f79e3e5 Mon Sep 17 00:00:00 2001 From: Hani Benhabiles Date: Sat, 31 May 2014 22:39:42 +0100 Subject: nbd: Shutdown socket before closing. This forces finishing data sending to client before closing the socket like in exports listing or replying with NBD_REP_ERR_UNSUP cases. Signed-off-by: Hani Benhabiles Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- qemu-nbd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'qemu-nbd.c') diff --git a/qemu-nbd.c b/qemu-nbd.c index ba60436..626e584 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -372,6 +372,7 @@ static void nbd_accept(void *opaque) if (nbd_client_new(exp, fd, nbd_client_closed)) { nb_fds++; } else { + shutdown(fd, 2); close(fd); } } -- cgit v1.1