
On 21.04.2015 10:14, Roman Bogorodskiy wrote:
When building without lxc support enabled, build fails with:
CLD vircapstest vircapstest.o: In function `test_virCapsDomainDataLookupLXC': vircapstest.c:(.text+0x9ef): undefined reference to `testLXCCapsInit'
Fix that by hiding LXC tests under appropriate #ifdef. --- tests/vircapstest.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/tests/vircapstest.c b/tests/vircapstest.c index 3e5038b..b2c321e 100644 --- a/tests/vircapstest.c +++ b/tests/vircapstest.c @@ -289,6 +289,7 @@ test_virCapsDomainDataLookupXen(const void *data ATTRIBUTE_UNUSED) return ret; }
+#ifdef WITH_LXC static int test_virCapsDomainDataLookupLXC(const void *data ATTRIBUTE_UNUSED) { @@ -311,6 +312,7 @@ test_virCapsDomainDataLookupLXC(const void *data ATTRIBUTE_UNUSED) virObjectUnref(caps); return ret; } +#endif /* WITH_LXC */
static int mymain(void) @@ -326,9 +328,11 @@ mymain(void) if (virtTestRun("virCapsDomainDataLookupXen", test_virCapsDomainDataLookupXen, NULL) < 0) ret = -1; +#ifdef WITH_LXC if (virtTestRun("virCapsDomainDataLookupLXC", test_virCapsDomainDataLookupLXC, NULL) < 0) ret = -1; +#endif /* WITH_LXC */
return ret; }
This fixes the problem only for LXC, while other drivers (qemu and xen) may have been disabled too. I'm squashing in the obvious fix, ACKing and pushing. Michal