]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-nbd: don't need call "stop()" seperately, and ~NBDServer will do it. 17283/head
authorPan Liu <wanjun.lp@alibaba-inc.com>
Sun, 27 Aug 2017 12:45:10 +0000 (20:45 +0800)
committerPan Liu <wanjun.lp@alibaba-inc.com>
Sun, 27 Aug 2017 12:45:10 +0000 (20:45 +0800)
Signed-off-by: Pan Liu <wanjun.lp@alibaba-inc.com>
src/tools/rbd_nbd/rbd-nbd.cc

index 5e7f98dcaa4d0b1bc775a50d73853f6832af9e01..5d86eaa45bd73d31fb2e0f4fa5b47c3955ee977b 100644 (file)
@@ -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);