[PATCH] librbd: Do not instantiate TrimRequest template class
authorBoris Ranto <branto@redhat.com>
Thu, 7 Dec 2017 23:21:38 +0000 (00:21 +0100)
committerBastien Roucariès <rouca@debian.org>
Sat, 21 Oct 2023 16:42:26 +0000 (17:42 +0100)
We include TrimRequest.cc in librbd tests at two places:
 - operation/test_mock_TrimRequest.cc
 - operation/test_mock_ResizeRequest.cc

That causes linking errors when doing the builds because some of the
instantiated classes are defined twice.

We can fix this by not instantiating the template class in the
TrimReqeust.cc file when including it in the tests.

Signed-off-by: Boris Ranto <branto@redhat.com>
Gbp-Pq: Name armhf-ftbfs.patch

src/test/librbd/operation/test_mock_ResizeRequest.cc

index e67f8a2a8321aefd5832a41acdf626509b0062b3..7b70a50e8f48f9a314cb6380094fd6e89a62a2f7 100644 (file)
@@ -44,7 +44,6 @@ TrimRequest<MockImageCtx> *TrimRequest<MockImageCtx>::s_instance = nullptr;
 
 // template definitions
 #include "librbd/operation/ResizeRequest.cc"
-#include "librbd/operation/TrimRequest.cc"
 
 namespace librbd {
 namespace operation {