]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: do not instantiate templates while building tests 14891/head
authorKefu Chai <kchai@redhat.com>
Wed, 3 May 2017 04:00:52 +0000 (12:00 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 4 May 2017 13:24:55 +0000 (21:24 +0800)
to avoid violation of ODR

Fixes: http://tracker.ceph.com/issues/18938
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/librbd/AsyncObjectThrottle.cc
src/librbd/AsyncRequest.cc
src/librbd/Journal.cc
src/librbd/operation/Request.cc

index 99f0bfda3e7e88051450e34b73423bc90b1ebdc6..1f09091e8f5e49573a5baeb13ebd3bf9a164fb28 100644 (file)
@@ -100,4 +100,6 @@ void AsyncObjectThrottle<T>::start_next_op() {
 
 } // namespace librbd
 
+#ifndef TEST_F
 template class librbd::AsyncObjectThrottle<librbd::ImageCtx>;
+#endif
index e6c25f076a69c62da0210577c35065b61e643601..a1e4202997d8ee3e4f60ecf3f49eed2b614c0ea4 100644 (file)
@@ -66,4 +66,6 @@ void AsyncRequest<T>::finish_request() {
 
 } // namespace librbd
 
+#ifndef TEST_F
 template class librbd::AsyncRequest<librbd::ImageCtx>;
+#endif
index 792437f43be3332481be11bb5444fb262f092fda..c19a6a80c50022f9b218f3a2e9625d5024052c32 100644 (file)
@@ -1768,4 +1768,6 @@ void Journal<I>::remove_listener(journal::Listener *listener) {
 
 } // namespace librbd
 
+#ifndef TEST_F
 template class librbd::Journal<librbd::ImageCtx>;
+#endif
index 7534004edc3140a3c19d0353021f08ac26d8c79e..d6201d4cb460f1b602a1f178253c1b8a1c5ee6ca 100644 (file)
@@ -178,4 +178,6 @@ void Request<I>::handle_op_event_safe(int r) {
 } // namespace operation
 } // namespace librbd
 
+#ifndef TEST_F
 template class librbd::operation::Request<librbd::ImageCtx>;
+#endif