diff options
author | Hani Benhabiles <kroosec@gmail.com> | 2014-05-31 22:39:42 +0100 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2014-07-15 19:28:02 -0500 |
commit | 0c60b74a0cc17a8fedb1b300b7b65ae946d917c9 (patch) | |
tree | 0254e88a30eefba295667c11af765602e9b69176 /qemu-nbd.c | |
parent | 25351f6a9ad55990d5140a928fd6ea29e48943af (diff) | |
download | qemu-0c60b74a0cc17a8fedb1b300b7b65ae946d917c9.tar.gz |
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 <kroosec@gmail.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 27e5eae4577316f7e86a56eb7363d4e78f79e3e5)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r-- | qemu-nbd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c index 7a2cff92c2..474966f468 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -302,6 +302,7 @@ static void nbd_accept(void *opaque) if (nbd_client_new(exp, fd, nbd_client_closed)) { nb_fds++; } else { + shutdown(fd, 2); close(fd); } } |