Avoid warnings like
qemu-nbd: Disconnect client, due to: Failed to read request:
Unexpected end-of-file before all bytes were read
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit
e1418e1975753bd3b5fbb7af88e361d3bbf7a1b6)
ldout(m_cct, 20) << dendl;
if (m_nbd != nullptr) {
+ // send a graceful shutdown to the server
+ // ignore errors -- we are read-only, also from the client's
+ // POV there is no disadvantage to abruptly closing the socket
+ // in nbd_close()
+ nbd_shutdown(m_nbd, 0);
+
nbd_close(m_nbd);
m_nbd = nullptr;
}