From 995773d423c57fd2efd5732caecb9d843d70366c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 3 May 2017 12:00:52 +0800 Subject: [PATCH] librbd: do not instantiate templates while building tests to avoid violation of ODR Fixes: http://tracker.ceph.com/issues/18938 Signed-off-by: Kefu Chai --- src/librbd/AsyncObjectThrottle.cc | 2 ++ src/librbd/AsyncRequest.cc | 2 ++ src/librbd/Journal.cc | 2 ++ src/librbd/operation/Request.cc | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/librbd/AsyncObjectThrottle.cc b/src/librbd/AsyncObjectThrottle.cc index 99f0bfda3e7e..1f09091e8f5e 100644 --- a/src/librbd/AsyncObjectThrottle.cc +++ b/src/librbd/AsyncObjectThrottle.cc @@ -100,4 +100,6 @@ void AsyncObjectThrottle::start_next_op() { } // namespace librbd +#ifndef TEST_F template class librbd::AsyncObjectThrottle; +#endif diff --git a/src/librbd/AsyncRequest.cc b/src/librbd/AsyncRequest.cc index e6c25f076a69..a1e4202997d8 100644 --- a/src/librbd/AsyncRequest.cc +++ b/src/librbd/AsyncRequest.cc @@ -66,4 +66,6 @@ void AsyncRequest::finish_request() { } // namespace librbd +#ifndef TEST_F template class librbd::AsyncRequest; +#endif diff --git a/src/librbd/Journal.cc b/src/librbd/Journal.cc index 792437f43be3..c19a6a80c500 100644 --- a/src/librbd/Journal.cc +++ b/src/librbd/Journal.cc @@ -1768,4 +1768,6 @@ void Journal::remove_listener(journal::Listener *listener) { } // namespace librbd +#ifndef TEST_F template class librbd::Journal; +#endif diff --git a/src/librbd/operation/Request.cc b/src/librbd/operation/Request.cc index 7534004edc31..d6201d4cb460 100644 --- a/src/librbd/operation/Request.cc +++ b/src/librbd/operation/Request.cc @@ -178,4 +178,6 @@ void Request::handle_op_event_safe(int r) { } // namespace operation } // namespace librbd +#ifndef TEST_F template class librbd::operation::Request; +#endif -- 2.47.3