vascom / rpms / ceph

Forked from rpms/ceph 4 years ago
Clone
9b4d322
From 74a754690736f6608b0d4d9c807df0bd777a129d Mon Sep 17 00:00:00 2001
9b4d322
From: Boris Ranto <branto@redhat.com>
9b4d322
Date: Fri, 8 Dec 2017 00:21:38 +0100
9b4d322
Subject: [PATCH] librbd: Conditionally import TrimRequest.cc
9b4d322
9b4d322
We include TrimRequest.cc in librbd tests at two places:
9b4d322
 - operation/test_mock_TrimRequest.cc
9b4d322
 - operation/test_mock_ResizeRequest.cc
9b4d322
9b4d322
That causes linking errors when doing the builds because some of the
9b4d322
structures are defined twice.
9b4d322
9b4d322
Signed-off-by: Boris Ranto <branto@redhat.com>
9b4d322
---
9b4d322
 src/librbd/operation/TrimRequest.cc | 2 ++
9b4d322
 1 file changed, 2 insertions(+)
9b4d322
9b4d322
diff --git a/src/librbd/operation/TrimRequest.cc b/src/librbd/operation/TrimRequest.cc
9b4d322
index 28f2deb..929ca51 100644
9b4d322
--- a/src/librbd/operation/TrimRequest.cc
9b4d322
+++ b/src/librbd/operation/TrimRequest.cc
9b4d322
@@ -362,4 +362,6 @@ void TrimRequest::send_finish(int r) {
9b4d322
 } // namespace operation
9b4d322
 } // namespace librbd
9b4d322
 
9b4d322
+#ifndef TEST_F
9b4d322
 template class librbd::operation::TrimRequest<librbd::ImageCtx>;
9b4d322
+#endif
9b4d322
-- 
9b4d322
2.9.5
9b4d322