[PATCH] tests: fix xlconfigtest build failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When libvirt is configured --without-xen, building the xlconfigtest
fails with

  CCLD   xlconfigtest
  /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o
  In function `_start': (.text+0x20): undefined reference to `main'
  collect2: error: ld returned 1 exit status

Introduced in commit 4ed5fb91 by too much copy and paste from
xmconfigtest.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 tests/Makefile.am    | 17 ++++++++++++-----
 tests/xlconfigtest.c |  4 ++--
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index b16d3d5..1d838a5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -483,11 +483,6 @@ sexpr2xmltest_SOURCES = \
 	testutils.c testutils.h
 sexpr2xmltest_LDADD = $(xen_LDADDS)
 
-xlconfigtest_SOURCES = \
-	xlconfigtest.c testutilsxen.c testutilsxen.h \
-	testutils.c testutils.h
-xlconfigtest_LDADD =$(xen_LDADDS)
-
 xmconfigtest_SOURCES = \
 	xmconfigtest.c testutilsxen.c testutilsxen.h \
 	testutils.c testutils.h
@@ -511,6 +506,18 @@ EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
 	testutilsxen.c testutilsxen.h
 endif ! WITH_XEN
 
+if WITH_LIBXL
+libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
+libxl_LDADDS += $(LDADDS)
+
+xlconfigtest_SOURCES = \
+	xlconfigtest.c testutilsxen.c testutilsxen.h \
+	testutils.c testutils.h
+xlconfigtest_LDADD =$(libxl_LDADDS)
+else ! WITH_LIBXL
+EXTRA_DIST += xlconfigtest.c
+endif ! WITH_LIBXL
+
 QEMUMONITORTESTUTILS_SOURCES = \
 	qemumonitortestutils.c \
 	qemumonitortestutils.h \
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index c2763c0..8c4c82c 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -36,7 +36,7 @@
 #include "virstring.h"
 #include "testutils.h"
 #include "testutilsxen.h"
-#include "xen/xen_driver.h"
+#include "libxl/libxl_conf.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
@@ -198,7 +198,7 @@ mymain(void)
     if (!(caps = testXLInitCaps()))
         return EXIT_FAILURE;
 
-    if (!(xmlopt = xenDomainXMLConfInit()))
+    if (!(xmlopt = libxlCreateXMLConf()))
         return EXIT_FAILURE;
 
 #define DO_TEST(name, version)                                          \
-- 
1.8.4.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]