[libvirt] mingw build regression
by Eric Blake
Using mingw32-portablexdr-4.0.11, I'm failing when cross-compiling from
F13 to mingw (during ./autobuild.sh) with:
remote/remote_protocol.c: In function 'xdr_remote_message_header':
remote/remote_protocol.c:3628: error: implicit declaration of function
'IXDR_PUT_U_INT32' [-Wimplicit-function-declaration]
remote/remote_protocol.c:3628: error: nested extern declaration of
'IXDR_PUT_U_INT32' [-Wnested-externs]
I know a newer rpm is available with portablexdr 4.9.x, but haven't
tried installing it yet. At any rate, it looks like the recent qemu
monitor stuff caused rpcgen to generate enough code to pull in a new
conversion that we hadn't previously used, but with a glibc-specific
spelling. Hopefully a simple #ifndef/#define of IXDR_PUT_U_INT32 will
solve the problem (at any rate, I recall seeing patches in the past for
some other translation helpers for other xdr code), if someone wants to
tackle this before me.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
14 years, 4 months
[libvirt] [PATCHv4] build: restore operation of bit-rotted 'make cov'
by Eric Blake
'./autobuild.sh' with lcov installed discovered that our
coverage support has been bit-rotting for a while. This
restores it back to a successful state, although I have
not yet spent any time looking through the resulting files to
look for low-hanging fruit in the unit test coverage front.
* configure.ac: Clear COMPILER_FLAGS at right place.
* Makefile.am (cov): Newer genhtml no longer likes plain -s.
* m4/compiler-flags.m4 (gl_COMPILER_FLAGS): Don't AC_SUBST
COMPILER_FLAGS; it is a shell variable for use in configure only.
* src/Makefile.am (AM_CFLAGS, AM_LDFLAGS): New variables, to make
it easier to provide global flag additions. Use throughout, to
uniformly apply coverage flags.
* .gitignore: Globally ignore gcov output.
* daemon/.gitignore: Simplify.
* src/.gitignore: Likewise.
* tests/.gitignore: Likewise.
---
v3 had an ACK at:
https://www.redhat.com/archives/libvir-list/2010-June/msg00660.html
but I never applied it because it was part of a larger series that
had not been completed.
I'm now at the point where this is easy enough to include in
0.8.3, while leaving the docs VPATH fixups for post release, but it
has changed enough to need another ACK before I can push.
Changes from v3:
rebase to present status (several conflicts resolved in src/Makefile.am)
fix 'cov' rule in Makefile.am to allow VPATH usage
.gitignore | 3 +
Makefile.am | 10 +++-
configure.ac | 1 +
daemon/.gitignore | 2 -
m4/compiler-flags.m4 | 1 -
src/.gitignore | 3 -
src/Makefile.am | 112 +++++++++++++++++++++++++++-----------------------
tests/.gitignore | 2 -
8 files changed, 71 insertions(+), 63 deletions(-)
diff --git a/.gitignore b/.gitignore
index 39ed671..c62e885 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,9 @@
*.#*#
*.a
*.exe
+*.gcda
+*.gcno
+*.gcov
*.o
*.orig
*.rej
diff --git a/Makefile.am b/Makefile.am
index a6af20f..c5d278b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,10 +68,14 @@ tests:
cov: clean-cov
mkdir $(top_builddir)/coverage
- $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d $(top_srcdir)/src -d $(top_srcdir)/daemon -d $(top_srcdir)/tests
- $(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp -o $(top_builddir)/coverage/libvirt.info *usr*
+ $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp \
+ -d $(top_builddir)/src -d $(top_builddir)/daemon \
+ -d $(top_builddir)/tests
+ $(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp \
+ -o $(top_builddir)/coverage/libvirt.info
rm $(top_builddir)/coverage/libvirt.info.tmp
- $(GENHTML) -s -t "libvirt" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libvirt.info
+ $(GENHTML) --show-details -t "libvirt" -o $(top_builddir)/coverage \
+ --legend $(top_builddir)/coverage/libvirt.info
clean-cov:
rm -rf $(top_builddir)/coverage
diff --git a/configure.ac b/configure.ac
index 7bc0e79..70432c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1752,6 +1752,7 @@ AC_ARG_ENABLE([test-coverage],
enable_coverage=$enableval
if test "${enable_coverage}" = yes; then
+ COMPILER_FLAGS=
gl_COMPILER_FLAGS(-fprofile-arcs)
gl_COMPILER_FLAGS(-ftest-coverage)
AC_SUBST([COVERAGE_CFLAGS], [$COMPILER_FLAGS])
diff --git a/daemon/.gitignore b/daemon/.gitignore
index 4e6123e..4475b6d 100644
--- a/daemon/.gitignore
+++ b/daemon/.gitignore
@@ -1,5 +1,3 @@
-*.gcda
-*.gcno
*.la
*.lo
.deps
diff --git a/m4/compiler-flags.m4 b/m4/compiler-flags.m4
index 628bd1f..6db4816 100644
--- a/m4/compiler-flags.m4
+++ b/m4/compiler-flags.m4
@@ -23,7 +23,6 @@
AC_DEFUN([gl_COMPILER_FLAGS],
[AC_MSG_CHECKING(whether compiler accepts $1)
- AC_SUBST(COMPILER_FLAGS)
ac_save_CFLAGS="$CFLAGS"
dnl Some flags are dependant, so we set all previously checked
dnl flags when testing. Except for -Werror which we have to
diff --git a/src/.gitignore b/src/.gitignore
index d24a87d..5d114c9 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -6,9 +6,6 @@ Makefile.in
*.loT
*.la
*.exe
-*.gcda
-*.gcno
-*.gcov
*.cov
libvirt_parthelper
libvirt_lxc
diff --git a/src/Makefile.am b/src/Makefile.am
index f71f72c..940bd33 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,6 +24,9 @@ INCLUDES = \
-DIN_LIBVIRT \
$(WIN32_EXTRA_CFLAGS)
+AM_CFLAGS = $(COVERAGE_CFLAGS)
+AM_LDFLAGS = $(COVERAGE_LDFLAGS)
+
EXTRA_DIST = $(conf_DATA)
BUILT_SOURCES =
@@ -420,20 +423,21 @@ libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
libvirt_util_la_SOURCES = \
$(UTIL_SOURCES)
-libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS)
+libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
+ $(AM_CFLAGS)
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) $(LIB_PTHREAD)
noinst_LTLIBRARIES += libvirt_conf.la
libvirt_la_BUILT_LIBADD += libvirt_conf.la
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
-libvirt_conf_la_CFLAGS =
-libvirt_conf_la_LDFLAGS =
+libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
+libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
noinst_LTLIBRARIES += libvirt_cpu.la
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
libvirt_cpu_la_CFLAGS = \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)
@@ -442,7 +446,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver.la
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
libvirt_driver_la_CFLAGS = $(NUMACTL_CFLAGS) $(GNUTLS_CFLAGS) \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
libvirt_driver_la_LIBADD = $(NUMACTL_LIBS) $(GNUTLS_LIBS)
USED_SYM_FILES = libvirt_private.syms
@@ -455,9 +459,9 @@ noinst_LTLIBRARIES += libvirt_driver_test.la
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
endif
libvirt_driver_test_la_CFLAGS = \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
if WITH_DRIVER_MODULES
-libvirt_driver_test_la_LDFLAGS = -module -avoid-version
+libvirt_driver_test_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
endif
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
endif
@@ -472,8 +476,9 @@ endif
libvirt_driver_remote_la_CFLAGS = \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_remote_la_LDFLAGS =
+ -I@top_srcdir@/src/conf \
+ $(AM_CFLAGS)
+libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) $(SASL_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_remote_la_LDFLAGS += -module -avoid-version
@@ -553,8 +558,9 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
endif
libvirt_driver_xen_la_CFLAGS = \
$(XEN_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_xen_la_LDFLAGS =
+ -I@top_srcdir@/src/conf \
+ $(AM_CFLAGS)
+libvirt_driver_xen_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_xen_la_LIBADD = $(XEN_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_xen_la_LDFLAGS += -module -avoid-version
@@ -571,7 +577,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
endif
libvirt_driver_phyp_la_LIBADD = $(LIBSSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(LIBSSH2_CFLAGS) \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
endif
@@ -583,9 +589,9 @@ noinst_LTLIBRARIES += libvirt_driver_openvz.la
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
endif
libvirt_driver_openvz_la_CFLAGS = \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
if WITH_DRIVER_MODULES
-libvirt_driver_openvz_la_LDFLAGS = -module -avoid-version
+libvirt_driver_openvz_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
endif
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
endif
@@ -598,9 +604,9 @@ noinst_LTLIBRARIES += libvirt_driver_vbox.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
endif
libvirt_driver_vbox_la_CFLAGS = \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
if WITH_DRIVER_MODULES
-libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version
+libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
endif
libvirt_driver_vbox_la_LIBADD = $(DLOPEN_LIBS)
libvirt_driver_vbox_la_SOURCES = $(VBOX_DRIVER_SOURCES)
@@ -614,8 +620,8 @@ noinst_LTLIBRARIES += libvirt_driver_xenapi.la
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
endif
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(LIBCURL_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_xenapi_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(LIBCURL_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_xenapi_la_LDFLAGS += -module -avoid-version
@@ -632,8 +638,8 @@ noinst_LTLIBRARIES += libvirt_driver_qemu.la
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
endif
libvirt_driver_qemu_la_CFLAGS = $(NUMACTL_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_qemu_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_qemu_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_qemu_la_LIBADD = $(NUMACTL_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_qemu_la_LDFLAGS += -module -avoid-version
@@ -659,9 +665,9 @@ noinst_LTLIBRARIES += libvirt_driver_lxc.la
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
endif
libvirt_driver_lxc_la_CFLAGS = \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
if WITH_DRIVER_MODULES
-libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version
+libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
endif
libvirt_driver_lxc_la_SOURCES = $(LXC_DRIVER_SOURCES)
@@ -682,8 +688,8 @@ noinst_LTLIBRARIES += libvirt_driver_uml.la
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
endif
libvirt_driver_uml_la_CFLAGS = $(NUMACTL_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_uml_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_uml_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_uml_la_LIBADD = $(NUMACTL_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_uml_la_LDFLAGS += -module -avoid-version
@@ -700,8 +706,8 @@ noinst_LTLIBRARIES += libvirt_driver_one.la
#libvirt_la_BUILT_LIBADD += libvirt_driver_one.la
endif
libvirt_driver_one_la_CFLAGS = $(XMLRPC_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_one_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_one_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_one_la_LIBADD = $(XMLRPC_LIBS)
#libvirt_driver_one_la_CFLAGS = "-DWITH_ONE"
if WITH_DRIVER_MODULES
@@ -724,8 +730,8 @@ noinst_LTLIBRARIES += libvirt_driver_esx.la
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
endif
libvirt_driver_esx_la_CFLAGS = $(LIBCURL_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_esx_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_esx_la_LIBADD = $(LIBCURL_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_esx_la_LDFLAGS += -module -avoid-version
@@ -743,9 +749,9 @@ noinst_LTLIBRARIES += libvirt_driver_network.la
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
endif
libvirt_driver_network_la_CFLAGS = \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
if WITH_DRIVER_MODULES
-libvirt_driver_network_la_LDFLAGS = -module -avoid-version
+libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
endif
libvirt_driver_network_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
endif
@@ -762,8 +768,8 @@ noinst_LTLIBRARIES += libvirt_driver_interface.la
libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
endif
libvirt_driver_interface_la_CFLAGS = $(NETCF_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_interface_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_interface_la_LIBADD = $(NETCF_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
@@ -780,9 +786,9 @@ noinst_LTLIBRARIES += libvirt_driver_secret.la
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
endif
libvirt_driver_secret_la_CFLAGS = \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
if WITH_DRIVER_MODULES
-libvirt_driver_secret_la_LDFLAGS = -module -avoid-version
+libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
endif
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
@@ -791,8 +797,8 @@ endif
# Needed to keep automake quiet about conditionals
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_CFLAGS = \
- -I@top_srcdir@/src/conf
-libvirt_driver_storage_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_la_LIBADD =
if WITH_STORAGE_DIR
if WITH_DRIVER_MODULES
@@ -843,8 +849,8 @@ endif
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)
libvirt_driver_nodedev_la_CFLAGS = \
- -I@top_srcdir@/src/conf
-libvirt_driver_nodedev_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nodedev_la_LIBADD =
if HAVE_HAL
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
@@ -871,8 +877,8 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
endif
libvirt_driver_nwfilter_la_CFLAGS = $(LIBPCAP_CFLAGS) \
- -I@top_srcdir@/src/conf
-libvirt_driver_nwfilter_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_nwfilter_la_LDFLAGS = $(LD_AMFLAGS)
libvirt_driver_nwfilter_la_LIBADD = $(LIBPCAP_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_nwfilter_la_LDFLAGS += -module -avoid-version
@@ -886,8 +892,8 @@ libvirt_driver_security_la_SOURCES = $(SECURITY_DRIVER_SOURCES)
noinst_LTLIBRARIES += libvirt_driver_security.la
libvirt_la_BUILT_LIBADD += libvirt_driver_security.la
libvirt_driver_security_la_CFLAGS = \
- -I@top_srcdir@/src/conf
-libvirt_driver_security_la_LDFLAGS =
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
+libvirt_driver_security_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_security_la_LIBADD =
if WITH_SECDRIVER_SELINUX
libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
@@ -1030,13 +1036,13 @@ libvirt.def: libvirt.syms
libvirt_la_SOURCES =
libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
-version-info $(LIBVIRT_VERSION_INFO) \
- $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
+ $(AM_LDFLAGS) \
$(CYGWIN_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS)
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
libvirt_la_LIBADD += $(LIBXML_LIBS) \
$(DRIVER_MODULE_LIBS) \
$(CYGWIN_EXTRA_LIBADD)
-libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
+libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
# Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we
# lose automake's automatic dependencies on an appropriate subset of
# $(libvirt_la_LIBADD). But we were careful to create
@@ -1058,8 +1064,8 @@ test_LDFLAGS = \
# Just like the above, but with a slightly different set of public symbols.
libvirt_test_la_SOURCES = $(libvirt_la_SOURCES)
libvirt_test_la_LIBADD = $(libvirt_la_LIBADD)
-libvirt_test_la_LDFLAGS = $(test_LDFLAGS)
-libvirt_test_la_CFLAGS = $(COVERAGE_CFLAGS)
+libvirt_test_la_LDFLAGS = $(test_LDFLAGS) $(AM_LDFLAGS)
+libvirt_test_la_CFLAGS = $(AM_CFLAGS)
libvirt_qemu_la_SOURCES = libvirt-qemu.c
libvirt_qemu_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
@@ -1075,14 +1081,14 @@ if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_parthelper
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
-libvirt_parthelper_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
+libvirt_parthelper_LDFLAGS = $(WARN_LDFLAGS) $(AM_LDFLAGS)
libvirt_parthelper_LDADD = \
$(LIBPARTED_LIBS) \
$(DEVMAPPER_LIBS) \
libvirt_util.la \
../gnulib/lib/libgnu.la
-libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS) $(DEVMAPPER_CFLAGS)
+libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS) $(AM_CFLAGS)
endif
endif
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)
@@ -1100,7 +1106,7 @@ libvirt_lxc_SOURCES = \
$(DOMAIN_CONF_SOURCES) \
$(CPU_CONF_SOURCES) \
$(NWFILTER_PARAM_CONF_SOURCES)
-libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
+libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(AM_LDFLAGS)
libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \
$(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \
$(LIBNL_LIBS) ../gnulib/lib/libgnu.la
@@ -1109,7 +1115,8 @@ libvirt_lxc_CFLAGS = \
$(NUMACTL_CFLAGS) \
$(CAPNG_CFLAGS) \
$(YAJL_CFLAGS) \
- -I@top_srcdir@/src/conf
+ -I@top_srcdir@/src/conf \
+ $(AM_CFLAGS)
endif
endif
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)
@@ -1120,7 +1127,7 @@ libexec_PROGRAMS += virt-aa-helper
virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
-virt_aa_helper_LDFLAGS = $(WARN_LDFLAGS)
+virt_aa_helper_LDFLAGS = $(WARN_LDFLAGS) $(AM_LDFLAGS)
virt_aa_helper_LDADD = \
$(LIBXML_LIBS) \
libvirt_conf.la \
@@ -1128,7 +1135,8 @@ virt_aa_helper_LDADD = \
../gnulib/lib/libgnu.la
virt_aa_helper_CFLAGS = \
-I@top_srcdir@/src/conf \
- -I@top_srcdir@/src/security
+ -I@top_srcdir@/src/security \
+ $(AM_CFLAGS)
endif
endif
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
diff --git a/tests/.gitignore b/tests/.gitignore
index 387a924..3f32939 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -23,8 +23,6 @@ statstest
qparamtest
seclabeltest
eventtest
-*.gcda
-*.gcno
*.exe
object-locking
object-locking.cmi
--
1.7.2
14 years, 4 months
[libvirt] [PATCH] build: fix 'make syntax-check' failure
by Eric Blake
src/lxc/veth.c:150: VIR_DEBUG(_("Failed to delete '%s' (%d)"),
src/lxc/veth.c:188: VIR_DEBUG(_("Failed to disable '%s' (%d)"),
maint.mk: do not mark these strings for translation
* src/lxc/veth.c (vethDelete, vethInterfaceUpOrDown): Don't
translate VIR_DEBUG.
---
Pushing as obvious.
src/lxc/veth.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/lxc/veth.c b/src/lxc/veth.c
index acf28c7..5f038d6 100644
--- a/src/lxc/veth.c
+++ b/src/lxc/veth.c
@@ -1,6 +1,7 @@
/*
* veth.c: Tools for managing veth pairs
*
+ * Copyright (C) 2010 Red Hat, Inc.
* Copyright IBM Corp. 2008
*
* See COPYING.LIB for the License of this software
@@ -147,7 +148,7 @@ int vethDelete(const char *veth)
* Prevent overwriting an error log which may be set
* where an actual failure occurs.
*/
- VIR_DEBUG(_("Failed to delete '%s' (%d)"),
+ VIR_DEBUG("Failed to delete '%s' (%d)",
veth, WEXITSTATUS(cmdResult));
rc = -1;
}
@@ -185,7 +186,7 @@ int vethInterfaceUpOrDown(const char* veth, int upOrDown)
* Prevent overwriting an error log which may be set
* where an actual failure occurs.
*/
- VIR_DEBUG(_("Failed to disable '%s' (%d)"),
+ VIR_DEBUG("Failed to disable '%s' (%d)",
veth, WEXITSTATUS(cmdResult));
else
vethError(VIR_ERR_INTERNAL_ERROR,
--
1.7.2
14 years, 4 months
[libvirt] Virt-install Error on Centos 5.4 64bit and kvm
by Cristian Rojas
Hi everyone:
using this command to install a kvm virtual machine:
virt-install --connect qemu:///system \
--name p3k0401 \
--ram 2048 \
--file //dev/VolGroup01/p3k0401logvol \
--accelerate \
-s 10 \
--nographics \
--hvm \
--location='http://10.1.4.80'
I get:
Starting install...
Retrieving file vmlinuz... | 1.8 MB 00:00
Retrieving file initrd.img... | 7.1 MB 00:00
ERROR internal error Domain p3k0401 didn't show up
Domain installation may not have been
successful. If it was, you can restart your domain
by running 'virsh start p3k0401'; otherwise, please
restart your installation.
ERROR internal error Domain p3k0401 didn't show up
Traceback (most recent call last):
File "/usr/sbin/virt-install", line 889, in ?
main()
File "/usr/sbin/virt-install", line 751, in main
start_time, guest.start_install)
File "/usr/sbin/virt-install", line 813, in do_install
dom = install_func(conscb, progresscb, wait=(not wait))
File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 541, in
start_install
return self._do_install(consolecb, meter, removeOld, wait)
File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 633, in
_do_install
self.domain = self.conn.createLinux(install_xml, 0)
File "/usr/lib64/python2.4/site-packages/libvirt.py", line 974, in
createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed',
conn=self)
libvirtError: internal error Domain p3k0401 didn't show up
On the /var/log/libvirt/qemu/p3k0401.log:
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/
/usr/bin/qemu-system-x86_64 -S -M rhel5.4.0 -m 1024 -smp 1 -name p3k0401
-uuid 7658c102-0738-724c-40eb-e1c58b2c2369 -domid 3 -nographic -monitor
pty -pidfile /var/run/libvirt/qemu//p3k0401.pid -no-reboot -boot c
-kernel /var/lib/libvirt/boot/virtinst-vmlinuz.O_SOVo -initrd
/var/lib/libvirt/boot/virtinst-initrd.img.0ba0Fp -append
method=http://10.1.4.80 -drive
file=//dev/VolGroup01/p3k0401logvol,if=ide,index=0,cache=none -net
nic,macaddr=54:52:00:15:c4:50,vlan=0 -net
tap,fd=16,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb
Supported machines are:
pc Standard PC (alias of pc-0.12)
pc-0.12 Standard PC (default)
pc-0.11 Standard PC, qemu 0.11
pc-0.10 Standard PC, qemu 0.10
isapc ISA-only PC
xenpv Xen Para-virtualized PC
And my packages installed:
# rpm -qa | grep qemu
qemu-0.12.4-1.el5.rf
# rpm -qa | grep kvm
etherboot-zroms-kvm-5.4.4-13.el5.centos
kmod-kvm-83-164.el5_5.12
kvm-83-164.el5_5.12
# rpm -qa | grep libvirt
libvirt-0.6.3-33.el5_5.1
libvirt-0.6.3-33.el5_5.1
libvirt-python-0.6.3-33.el5_5.1
# uname -a
Linux gs1p304 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64
x86_64 x86_64 GNU/Linux
Please any pointer is appreciated...
Thanks
Cris
14 years, 4 months
[libvirt] [PATCH] lxc: Fix return value handlings of vethInterfaceUpOrDown and moveInterfaceToNetNs
by Ryota Ozaki
Both may return a positive value when they fail. We should check
if the value is not zero instead of checking if it's negative.
lxcContainerRenameAndEnableInterfaces is expected to return a negative
value on a failure, so the patch changes the return value to -1
if vethInterfaceUpOrDown fails.
Note that this patch may be related to the bug:
https://bugzilla.redhat.com/show_bug.cgi?id=607496 .
It would not fix the bug, but would unveil what happens.
---
src/lxc/lxc_container.c | 7 ++++++-
src/lxc/lxc_controller.c | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 4371dba..c77d262 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -273,8 +273,13 @@ static int lxcContainerRenameAndEnableInterfaces(unsigned int nveths,
}
/* enable lo device only if there were other net devices */
- if (veths)
+ if (veths) {
rc = vethInterfaceUpOrDown("lo", 1);
+ if (0 != rc) {
+ VIR_ERROR(_("Failed to enable lo (%d)"), rc);
+ rc = -1;
+ }
+ }
error_out:
VIR_FREE(newname);
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index d8b7bc7..9829a69 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -477,7 +477,7 @@ static int lxcControllerMoveInterfaces(unsigned int nveths,
{
unsigned int i;
for (i = 0 ; i < nveths ; i++)
- if (moveInterfaceToNetNs(veths[i], container) < 0) {
+ if (moveInterfaceToNetNs(veths[i], container) != 0) {
lxcError(VIR_ERR_INTERNAL_ERROR,
_("Failed to move interface %s to ns %d"),
veths[i], container);
--
1.6.6.1
14 years, 4 months
[libvirt] [PATCH] Eliminate memory leak in xenUnifiedDomainInfoListFree
by Laine Stump
From: Laine Stump <laine(a)redhat.com>
This fixes a leak described in
https://bugzilla.redhat.com/show_bug.cgi?id=590073
xenUnifiedDomainInfoList has a pointer to a list of pointers to
xenUnifiedDomain. We were freeing up all the domains, but neglecting
to free the list.
This was found by Paolo Bonzini <pbonzini(a)redhat.com>.
---
src/xen/xen_driver.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index d121ea4..ddbfa7a 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -2044,6 +2044,7 @@ xenUnifiedDomainInfoListFree(xenUnifiedDomainInfoListPtr list)
VIR_FREE(list->doms[i]->name);
VIR_FREE(list->doms[i]);
}
+ VIR_FREE(list->doms);
VIR_FREE(list);
}
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] Fix --with-xen-proxy related compile error
by Matthias Bolte
Move virDomainChrTargetTypeToString out of the #ifndef PROXY
block, because it's used outside of it.
---
src/conf/domain_conf.c | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 82e5ce7..883c682 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2441,26 +2441,6 @@ out:
return ret;
}
-static const char *
-virDomainChrTargetTypeToString(int deviceType,
- int targetType)
-{
- const char *type = NULL;
-
- switch (deviceType) {
- case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
- type = virDomainChrChannelTargetTypeToString(targetType);
- break;
- case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
- type = virDomainChrConsoleTargetTypeToString(targetType);
- break;
- default:
- break;
- }
-
- return type;
-}
-
static int
virDomainChrDefParseTargetXML(virCapsPtr caps,
virDomainChrDefPtr def,
@@ -3952,6 +3932,26 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
#endif /* !PROXY */
+static const char *
+virDomainChrTargetTypeToString(int deviceType,
+ int targetType)
+{
+ const char *type = NULL;
+
+ switch (deviceType) {
+ case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
+ type = virDomainChrChannelTargetTypeToString(targetType);
+ break;
+ case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+ type = virDomainChrConsoleTargetTypeToString(targetType);
+ break;
+ default:
+ break;
+ }
+
+ return type;
+}
+
static void
virVirtualPortProfileFormat(virBufferPtr buf,
virVirtualPortProfileParamsPtr virtPort,
--
1.7.0.4
14 years, 4 months
[libvirt] [PATCH] lxc: Fix 'autostart' doesn't take effect actually
by Ryota Ozaki
lxcStartup forgot to call lxcAutostartConfigs. Fix it.
This patch should fix https://bugzilla.redhat.com/show_bug.cgi?id=589863 .
---
src/lxc/lxc_driver.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 4fc1ecd..b286692 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1928,6 +1928,9 @@ static int lxcStartup(int privileged)
virHashForEach(lxc_driver->domains.objs, lxcReconnectVM, lxc_driver);
lxcDriverUnlock(lxc_driver);
+
+ lxcAutostartConfigs(lxc_driver);
+
return 0;
cleanup:
--
1.6.6.1
14 years, 4 months