[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 092/108] nbd: Shutdown socket before closing.
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 092/108] nbd: Shutdown socket before closing. |
Date: |
Wed, 6 Aug 2014 15:39:42 -0500 |
From: Hani Benhabiles <address@hidden>
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 <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit 27e5eae4577316f7e86a56eb7363d4e78f79e3e5)
Signed-off-by: Michael Roth <address@hidden>
---
blockdev-nbd.c | 1 +
qemu-nbd.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index 18dc528..b3a2474 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -28,6 +28,7 @@ static void nbd_accept(void *opaque)
int fd = accept(server_fd, (struct sockaddr *)&addr, &addr_len);
if (fd >= 0 && !nbd_client_new(NULL, fd, nbd_client_put)) {
+ shutdown(fd, 2);
close(fd);
}
}
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 4f53b9b..8a49798 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);
}
}
--
1.9.1
- [Qemu-stable] [PATCH 084/108] hw/xtensa/xtfpga: fix FLASH mapping to boot region for KC705, (continued)
- [Qemu-stable] [PATCH 084/108] hw/xtensa/xtfpga: fix FLASH mapping to boot region for KC705, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 085/108] target-i386: Make TCG feature filtering more readable, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 088/108] virtio-serial: don't migrate the config space, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 087/108] virtio-net: byteswap virtio-net header, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 090/108] nbd: Don't validate from and len in NBD_CMD_DISC., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 089/108] nbd: Don't export a block device with no medium., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 074/108] hw: Consistently name Error ** objects errp, and not err, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 094/108] pc: make isapc and pc-0.10 to pc-0.13 have 1.7.0 memory layout, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 091/108] nbd: Close socket on negotiation failure., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 095/108] sdhci: Fix misuse of qemu_free_irqs(), Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 092/108] nbd: Shutdown socket before closing.,
Michael Roth <=
- [Qemu-stable] [PATCH 096/108] hw: Fix qemu_allocate_irqs() leaks, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 093/108] SMBIOS: Rename symbols to better reflect future use, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 097/108] virtio: out-of-bounds buffer write on invalid state load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 098/108] virtio: validate config_len on load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 106/108] vmstate_xhci_event: fix unterminated field list, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 099/108] Allow mismatched virtio config-len, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 105/108] kvm-all: Use 'tmpcpu' instead of 'cpu' in sub-looping to avoid 'cpu' be NULL, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 103/108] s390x/kvm: synchronize guest floating point registers, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 102/108] disas/libvixl: prepend the include path of libvixl header files, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 104/108] cadence_uart: check for serial backend before using it., Michael Roth, 2014/08/06