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