From: Pan Liu Date: Sun, 27 Aug 2017 12:45:10 +0000 (+0800) Subject: rbd-nbd: don't need call "stop()" seperately, and ~NBDServer will do it. X-Git-Tag: v13.0.1~1152^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=622e90edd234d75a240895b8961b7088a6c50de7;p=ceph.git rbd-nbd: don't need call "stop()" seperately, and ~NBDServer will do it. Signed-off-by: Pan Liu --- diff --git a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc index 5e7f98dcaa4d..5d86eaa45bd7 100644 --- a/src/tools/rbd_nbd/rbd-nbd.cc +++ b/src/tools/rbd_nbd/rbd-nbd.cc @@ -246,7 +246,7 @@ private: ctx->data.append_zero(pad_byte_count); dout(20) << __func__ << ": " << *ctx << ": Pad byte count: " << pad_byte_count << dendl; - ctx->reply.error = 0; + ctx->reply.error = htonl(0); } else { ctx->reply.error = htonl(0); } @@ -396,7 +396,7 @@ public: } } - void stop() + ~NBDServer() { if (started) { dout(10) << __func__ << ": terminating" << dendl; @@ -411,11 +411,6 @@ public: started = false; } } - - ~NBDServer() - { - stop(); - } }; std::ostream &operator<<(std::ostream &os, const NBDServer::IOContext &ctx) { @@ -761,8 +756,6 @@ static int do_map(int argc, const char *argv[], Config *cfg) unregister_async_signal_handler(SIGINT, handle_signal); unregister_async_signal_handler(SIGTERM, handle_signal); shutdown_async_signal_handler(); - - server.stop(); } r = image.update_unwatch(handle);