Re: [libvirt] [PATCH] fix --without-xen build

2008-11-24 Thread Daniel P. Berrange
On Fri, Nov 21, 2008 at 12:46:59PM -0500, David Lively wrote:
 Okay, *this* one seems to be a complete fix.

Not quite. The ENABLE_XEN_TESTS conditional is only set when not
running on a live Xen kernel, which is a different conditional
from disabling Xen driver entirely. It also shouldn't skip out
sub-directories because we need 'make dist' to include them even
when Xen build is disabled.

Try out this patch which should do what you were after. It also removes
some pointless conditionals from the source files - we don't need WITH_XEN
in the source, if we're disabling the build entirely in the Makefile.am


Index: tests/Makefile.am
===
RCS file: /data/cvs/libvirt/tests/Makefile.am,v
retrieving revision 1.59
diff -u -p -r1.59 Makefile.am
--- tests/Makefile.am   24 Nov 2008 07:13:30 -  1.59
+++ tests/Makefile.am   24 Nov 2008 15:47:46 -
@@ -43,10 +43,13 @@ EXTRA_DIST =\
nodeinfodata \
domainschematest
 
-noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
-   reconnect xmconfigtest xencapstest \
+noinst_PROGRAMS = xmlrpctest virshtest conftest \
 nodeinfotest statstest qparamtest
 
+if WITH_XEN
+noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \
+   reconnect xmconfigtest xencapstest
+endif
 if WITH_QEMU
 noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest
 endif
@@ -68,12 +71,22 @@ endif
 
 EXTRA_DIST += $(test_scripts)
 
-TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \
-xencapstest nodeinfotest \
-   statstest qparamtest $(test_scripts)
+TESTS = virshtest \
+nodeinfotest \
+   statstest \
+   qparamtest \
+   $(test_scripts)
+
+if WITH_XEN
+TESTS += xml2sexprtest \
+   sexpr2xmltest \
+   xmconfigtest \
+   xencapstest
 if ENABLE_XEN_TESTS
-  TESTS += reconnect
+TESTS += reconnect
+endif
 endif
+
 if WITH_QEMU
 TESTS += qemuxml2argvtest qemuxml2xmltest
 endif
@@ -105,6 +118,7 @@ xmlrpctest_SOURCES = \
 
 xmlrpctest_LDADD = $(LDADDS)
 
+if WITH_XEN
 xml2sexprtest_SOURCES = \
xml2sexprtest.c testutilsxen.c testutilsxen.h \
testutils.c testutils.h
@@ -120,6 +134,20 @@ xmconfigtest_SOURCES = \
testutils.c testutils.h
 xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
 
+xencapstest_SOURCES = \
+   xencapstest.c testutils.h testutils.c
+xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+
+reconnect_SOURCES = \
+   reconnect.c
+reconnect_LDADD = $(LDADDS)
+
+else
+EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
+   xencapstest.c reconnect.c \
+   testutilsxen.c testutilsxen.h
+endif
+
 if WITH_QEMU
 qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
@@ -143,10 +171,6 @@ conftest_SOURCES = \
conftest.c
 conftest_LDADD = $(LDADDS)
 
-xencapstest_SOURCES = \
-   xencapstest.c testutils.h testutils.c
-xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
-
 nodeinfotest_SOURCES = \
nodeinfotest.c testutils.h testutils.c
 nodeinfotest_LDADD = $(LDADDS)
@@ -159,8 +183,4 @@ qparamtest_SOURCES = \
qparamtest.c testutils.h testutils.c
 qparamtest_LDADD = $(LDADDS)
 
-reconnect_SOURCES = \
-   reconnect.c
-reconnect_LDADD = $(LDADDS)
-
 CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
Index: tests/sexpr2xmltest.c
===
RCS file: /data/cvs/libvirt/tests/sexpr2xmltest.c,v
retrieving revision 1.32
diff -u -p -r1.32 sexpr2xmltest.c
--- tests/sexpr2xmltest.c   9 Sep 2008 13:53:58 -   1.32
+++ tests/sexpr2xmltest.c   24 Nov 2008 15:47:46 -
@@ -4,8 +4,6 @@
 #include string.h
 #include unistd.h
 
-#ifdef WITH_XEN
-
 #include internal.h
 #include xml.h
 #include xend_internal.h
@@ -146,11 +144,3 @@ mymain(int argc, char **argv)
 
 VIRT_TEST_MAIN(mymain)
 
-#else /* WITHOUT_XEN */
-int
-main(void)
-{
-fprintf(stderr, libvirt compiled without Xen support\n);
-return(0);
-}
-#endif /* WITH_XEN */
Index: tests/testutilsxen.c
===
RCS file: /data/cvs/libvirt/tests/testutilsxen.c,v
retrieving revision 1.2
diff -u -p -r1.2 testutilsxen.c
--- tests/testutilsxen.c12 Aug 2008 08:25:48 -  1.2
+++ tests/testutilsxen.c24 Nov 2008 15:47:46 -
@@ -1,6 +1,5 @@
 #include config.h
 
-#ifdef WITH_XEN
 #include sys/utsname.h
 #include stdlib.h
 
@@ -52,4 +51,3 @@ cleanup:
 virCapabilitiesFree(caps);
 return NULL;
 }
-#endif
Index: tests/xencapstest.c
===
RCS file: /data/cvs/libvirt/tests/xencapstest.c,v
retrieving revision 1.15
diff -u -p -r1.15 xencapstest.c
--- tests/xencapstest.c 5 Sep 2008 11:35:44 -   1.15
+++ tests/xencapstest.c 24 Nov 2008 15:47:46 -
@@ -5,8 +5,6 @@
 #include string.h
 #include unistd.h
 
-#ifdef 

Re: [libvirt] [PATCH] fix --without-xen build

2008-11-24 Thread Ben Guthro
This fixed it in our environment

ACK

Daniel P. Berrange wrote on 11/24/2008 10:50 AM:
 On Fri, Nov 21, 2008 at 12:46:59PM -0500, David Lively wrote:
 Okay, *this* one seems to be a complete fix.
 
 Not quite. The ENABLE_XEN_TESTS conditional is only set when not
 running on a live Xen kernel, which is a different conditional
 from disabling Xen driver entirely. It also shouldn't skip out
 sub-directories because we need 'make dist' to include them even
 when Xen build is disabled.
 
 Try out this patch which should do what you were after. It also removes
 some pointless conditionals from the source files - we don't need WITH_XEN
 in the source, if we're disabling the build entirely in the Makefile.am
 
 
 Index: tests/Makefile.am
 ===
 RCS file: /data/cvs/libvirt/tests/Makefile.am,v
 retrieving revision 1.59
 diff -u -p -r1.59 Makefile.am
 --- tests/Makefile.am 24 Nov 2008 07:13:30 -  1.59
 +++ tests/Makefile.am 24 Nov 2008 15:47:46 -
 @@ -43,10 +43,13 @@ EXTRA_DIST =  \
   nodeinfodata \
   domainschematest
  
 -noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
 - reconnect xmconfigtest xencapstest \
 +noinst_PROGRAMS = xmlrpctest virshtest conftest \
  nodeinfotest statstest qparamtest
  
 +if WITH_XEN
 +noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \
 + reconnect xmconfigtest xencapstest
 +endif
  if WITH_QEMU
  noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest
  endif
 @@ -68,12 +71,22 @@ endif
  
  EXTRA_DIST += $(test_scripts)
  
 -TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \
 -xencapstest nodeinfotest \
 - statstest qparamtest $(test_scripts)
 +TESTS = virshtest \
 +nodeinfotest \
 + statstest \
 + qparamtest \
 + $(test_scripts)
 +
 +if WITH_XEN
 +TESTS += xml2sexprtest \
 + sexpr2xmltest \
 + xmconfigtest \
 + xencapstest
  if ENABLE_XEN_TESTS
 -  TESTS += reconnect
 +TESTS += reconnect
 +endif
  endif
 +
  if WITH_QEMU
  TESTS += qemuxml2argvtest qemuxml2xmltest
  endif
 @@ -105,6 +118,7 @@ xmlrpctest_SOURCES = \
  
  xmlrpctest_LDADD = $(LDADDS)
  
 +if WITH_XEN
  xml2sexprtest_SOURCES = \
   xml2sexprtest.c testutilsxen.c testutilsxen.h \
   testutils.c testutils.h
 @@ -120,6 +134,20 @@ xmconfigtest_SOURCES = \
   testutils.c testutils.h
  xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
  
 +xencapstest_SOURCES = \
 + xencapstest.c testutils.h testutils.c
 +xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
 +
 +reconnect_SOURCES = \
 + reconnect.c
 +reconnect_LDADD = $(LDADDS)
 +
 +else
 +EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
 + xencapstest.c reconnect.c \
 + testutilsxen.c testutilsxen.h
 +endif
 +
  if WITH_QEMU
  qemuxml2argvtest_SOURCES = \
   qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
 @@ -143,10 +171,6 @@ conftest_SOURCES = \
   conftest.c
  conftest_LDADD = $(LDADDS)
  
 -xencapstest_SOURCES = \
 - xencapstest.c testutils.h testutils.c
 -xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
 -
  nodeinfotest_SOURCES = \
   nodeinfotest.c testutils.h testutils.c
  nodeinfotest_LDADD = $(LDADDS)
 @@ -159,8 +183,4 @@ qparamtest_SOURCES = \
   qparamtest.c testutils.h testutils.c
  qparamtest_LDADD = $(LDADDS)
  
 -reconnect_SOURCES = \
 - reconnect.c
 -reconnect_LDADD = $(LDADDS)
 -
  CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
 Index: tests/sexpr2xmltest.c
 ===
 RCS file: /data/cvs/libvirt/tests/sexpr2xmltest.c,v
 retrieving revision 1.32
 diff -u -p -r1.32 sexpr2xmltest.c
 --- tests/sexpr2xmltest.c 9 Sep 2008 13:53:58 -   1.32
 +++ tests/sexpr2xmltest.c 24 Nov 2008 15:47:46 -
 @@ -4,8 +4,6 @@
  #include string.h
  #include unistd.h
  
 -#ifdef WITH_XEN
 -
  #include internal.h
  #include xml.h
  #include xend_internal.h
 @@ -146,11 +144,3 @@ mymain(int argc, char **argv)
  
  VIRT_TEST_MAIN(mymain)
  
 -#else /* WITHOUT_XEN */
 -int
 -main(void)
 -{
 -fprintf(stderr, libvirt compiled without Xen support\n);
 -return(0);
 -}
 -#endif /* WITH_XEN */
 Index: tests/testutilsxen.c
 ===
 RCS file: /data/cvs/libvirt/tests/testutilsxen.c,v
 retrieving revision 1.2
 diff -u -p -r1.2 testutilsxen.c
 --- tests/testutilsxen.c  12 Aug 2008 08:25:48 -  1.2
 +++ tests/testutilsxen.c  24 Nov 2008 15:47:46 -
 @@ -1,6 +1,5 @@
  #include config.h
  
 -#ifdef WITH_XEN
  #include sys/utsname.h
  #include stdlib.h
  
 @@ -52,4 +51,3 @@ cleanup:
  virCapabilitiesFree(caps);
  return NULL;
  }
 -#endif
 Index: tests/xencapstest.c
 ===
 RCS file: /data/cvs/libvirt/tests/xencapstest.c,v
 retrieving revision 1.15
 diff -u -p -r1.15 

Re: [libvirt] [PATCH] fix --without-xen build

2008-11-24 Thread Daniel P. Berrange
On Mon, Nov 24, 2008 at 11:46:56AM -0500, Ben Guthro wrote:
 This fixed it in our environment

Great, committed this fix now.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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


Re: [libvirt] [PATCH] fix --without-xen build

2008-11-21 Thread David Lively
Hold off on considering this quite yet.  I don't think it's a complete
fix.  I'll followup with a complete one soon.

Dave


On Fri, 2008-11-21 at 11:04 -0500, David Lively wrote:
 The last change to tests/Makefile.am broke the build when --without-xen
 is specified.  This patch fixes it ...
 
 Dave
 
 
  tests/Makefile.am |9 +
  1 file changed, 9 insertions(+)
 
 
 --
 Libvir-list mailing list
 Libvir-list@redhat.com
 https://www.redhat.com/mailman/listinfo/libvir-list

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


Re: [libvirt] [PATCH] fix --without-xen build

2008-11-21 Thread David Lively
Okay, *this* one seems to be a complete fix.

Dave

 tests/Makefile.am |   29 ++---
 1 file changed, 22 insertions(+), 7 deletions(-)

On Fri, 2008-11-21 at 12:35 -0500, David Lively wrote:
 Hold off on considering this quite yet.  I don't think it's a complete
 fix.  I'll followup with a complete one soon.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index d2d1254..a17fdd4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,8 +2,11 @@
 
 SHELL = $(PREFERABLY_POSIX_SHELL)
 
-SUBDIRS = virshdata confdata sexpr2xmldata \
-  xml2sexprdata xmconfigdata xencapsdata
+SUBDIRS = virshdata confdata
+
+if ENABLE_XEN_TESTS
+SUBDIRS += sexpr2xmldata xml2sexprdata xmconfigdata xencapsdata
+endif
 
 INCLUDES = \
 	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
@@ -43,10 +46,14 @@ EXTRA_DIST =		\
 	nodeinfodata \
 	domainschematest
 
-noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
-	reconnect xmconfigtest xencapstest \
+noinst_PROGRAMS = xmlrpctest virshtest conftest \
 nodeinfotest statstest qparamtest
 
+if ENABLE_XEN_TESTS
+noinst_PROGRAMS += xml2sexprtest sexpr2xmltest reconnect xmconfigtest \
+	xencapstest
+endif
+
 if WITH_QEMU
 noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest
 endif
@@ -66,11 +73,10 @@ endif
 
 EXTRA_DIST += $(test_scripts)
 
-TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \
-xencapstest nodeinfotest \
+TESTS = virshtest nodeinfotest \
 	statstest qparamtest $(test_scripts)
 if ENABLE_XEN_TESTS
-  TESTS += reconnect
+  TESTS += reconnect xml2sexprtest sexpr2xmltest xmconfigtest xencapstest
 endif
 if WITH_QEMU
 TESTS += qemuxml2argvtest qemuxml2xmltest
@@ -103,6 +109,7 @@ xmlrpctest_SOURCES = \
 
 xmlrpctest_LDADD = $(LDADDS)
 
+if ENABLE_XEN_TESTS
 xml2sexprtest_SOURCES = \
 	xml2sexprtest.c testutilsxen.c testutilsxen.h \
 	testutils.c testutils.h
@@ -117,6 +124,10 @@ xmconfigtest_SOURCES = \
 	xmconfigtest.c testutilsxen.c testutilsxen.h \
 	testutils.c testutils.h
 xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+else
+EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
+	testutilsxen.c testutilsxen.h
+endif
 
 if WITH_QEMU
 qemuxml2argvtest_SOURCES = \
@@ -141,9 +152,13 @@ conftest_SOURCES = \
 	conftest.c
 conftest_LDADD = $(LDADDS)
 
+if ENABLE_XEN_TESTS
 xencapstest_SOURCES = \
 	xencapstest.c testutils.h testutils.c
 xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+else
+EXTRA_DIST += xencapstest.c
+endif
 
 nodeinfotest_SOURCES = \
 	nodeinfotest.c testutils.h testutils.c
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list