Just like the similar series that already went in for libguestfs [1], do similar fixes also for virt-v2v, with additional fixes for the builddir!=srcdir case. This will also need the fix to subdir-rules.mk. [1] https://www.redhat.com/archives/libguestfs/2019-December/msg00062.html Pino Toscano (7): Update common to latest build: stop shipping files generated by configure build: use the mlv2v library build: do not ship generated sources build: drop HAVE_OCAML conditionals build: actually require libvirt build: hopefully fix dependencies on generated files .gitignore | 2 -- common | 2 +- m4/guestfs-libraries.m4 | 22 ++------------------- ocaml-dep.sh.in | 1 + po/POTFILES-ml | 1 - test-harness/Makefile.am | 4 ---- tests/Makefile.am | 2 -- v2v/Makefile.am | 42 ++++++++++++++-------------------------- 8 files changed, 19 insertions(+), 57 deletions(-) -- 2.23.0
--- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 22d796ef..dd230649 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 22d796efc69de44d0ff1aad6796ac4b31b8b3dc7 +Subproject commit dd2306496ef5518be14df53cce1f762233770871 -- 2.23.0
Pino Toscano
2019-Dec-13 16:01 UTC
[Libguestfs] [v2v PATCH 2/7] build: stop shipping files generated by configure
They will be generated by configure. --- v2v/Makefile.am | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/v2v/Makefile.am b/v2v/Makefile.am index bb816ac9..2cb3480c 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -18,7 +18,6 @@ include $(top_srcdir)/subdir-rules.mk BUILT_SOURCES = \ - config.ml \ output_rhv_upload_createvm_source.ml \ output_rhv_upload_deletedisks_source.ml \ output_rhv_upload_plugin_source.ml \ @@ -27,8 +26,13 @@ BUILT_SOURCES = \ uefi.ml \ uefi.mli +CONFIGURE_GENERATED_ML = \ + config.ml + EXTRA_DIST = \ - $(SOURCES_MLI) $(SOURCES_ML) $(SOURCES_C) \ + $(SOURCES_MLI) \ + $(filter-out $(CONFIGURE_GENERATED_ML),$(SOURCES_ML)) \ + $(SOURCES_C) \ copy_to_local.ml \ copy_to_local.mli \ embed.sh \ @@ -103,7 +107,7 @@ SOURCES_MLI = \ windows_virtio.mli SOURCES_ML = \ - config.ml \ + $(CONFIGURE_GENERATED_ML) \ types.ml \ uefi.ml \ utils.ml \ -- 2.23.0
Pino Toscano
2019-Dec-13 16:01 UTC
[Libguestfs] [v2v PATCH 3/7] build: use the mlv2v library
Instead of copying the sources of mlv2v into the v2v build directory, use the mlv2v convenience library instead. --- .gitignore | 2 -- ocaml-dep.sh.in | 1 + po/POTFILES-ml | 1 - v2v/Makefile.am | 24 ++++++------------------ 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 19ee3335..ee7e3cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -135,8 +135,6 @@ Makefile.in /v2v/real-*.d/ /v2v/real-*.img /v2v/real-*.xml -/v2v/uefi.ml -/v2v/uefi.mli /v2v/v2v_unit_tests /v2v/var_expander_tests /v2v/virt-v2v diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in index 9de8497f..340e7cc6 100755 --- a/ocaml-dep.sh.in +++ b/ocaml-dep.sh.in @@ -40,6 +40,7 @@ common/mlprogress common/mlstdutils common/mltools common/mlutils +common/mlv2v common/mlvisit common/mlxml customize diff --git a/po/POTFILES-ml b/po/POTFILES-ml index eef7c5f3..85ded8be 100644 --- a/po/POTFILES-ml +++ b/po/POTFILES-ml @@ -86,7 +86,6 @@ v2v/python_script.ml v2v/qemuopts.ml v2v/target_bus_assignment.ml v2v/types.ml -v2v/uefi.ml v2v/utils.ml v2v/v2v.ml v2v/v2v_unit_tests.ml diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 2cb3480c..63473515 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -22,9 +22,7 @@ BUILT_SOURCES = \ output_rhv_upload_deletedisks_source.ml \ output_rhv_upload_plugin_source.ml \ output_rhv_upload_precheck_source.ml \ - output_rhv_upload_vmcheck_source.ml \ - uefi.ml \ - uefi.mli + output_rhv_upload_vmcheck_source.ml CONFIGURE_GENERATED_ML = \ config.ml @@ -98,8 +96,6 @@ SOURCES_MLI = \ qemuopts.mli \ target_bus_assignment.mli \ types.mli \ - uefi.mli \ - utils.mli \ v2v.mli \ vCenter.mli \ var_expander.mli \ @@ -109,7 +105,6 @@ SOURCES_MLI = \ SOURCES_ML = \ $(CONFIGURE_GENERATED_ML) \ types.ml \ - uefi.ml \ utils.ml \ var_expander.ml \ python_script.ml \ @@ -182,15 +177,6 @@ output_rhv_upload_precheck_source.ml: $(srcdir)/rhv-upload-precheck.py output_rhv_upload_vmcheck_source.ml: $(srcdir)/rhv-upload-vmcheck.py $(srcdir)/embed.sh code $^ $@ -# These are created by the generator in common/mlv2v and -# need to be copied here. -uefi.mli: $(top_srcdir)/common/mlv2v/uefi.mli - rm -f $@ - cp $< $@ -uefi.ml: $(top_srcdir)/common/mlv2v/uefi.ml - rm -f $@ - cp $< $@ - if HAVE_OCAML bin_PROGRAMS = virt-v2v virt-v2v-copy-to-local @@ -229,7 +215,8 @@ OCAMLPACKAGES = \ -I $(top_builddir)/common/mlxml \ -I $(top_builddir)/common/mltools \ -I $(top_builddir)/common/mllibvirt \ - -I $(top_builddir)/common/mlcustomize + -I $(top_builddir)/common/mlcustomize \ + -I $(top_builddir)/common/mlv2v if HAVE_OCAML_PKG_GETTEXT OCAMLPACKAGES += -package gettext-stub endif @@ -259,6 +246,7 @@ OCAMLLINKFLAGS = \ mltools.$(MLARCHIVE) \ mllibvirt.$(MLARCHIVE) \ mlcustomize.$(MLARCHIVE) \ + mlv2v.$(MLARCHIVE) \ $(LINK_CUSTOM_OCAMLC_ONLY) virt_v2v_DEPENDENCIES = $(OBJECTS) $(top_srcdir)/ocaml-link.sh @@ -282,7 +270,6 @@ virt_v2v_copy_to_local_CFLAGS = \ COPY_TO_LOCAL_BOBJECTS = \ config.cmo \ types.cmo \ - uefi.cmo \ utils.cmo \ libvirt_utils.cmo \ nbdkit.cmo \ @@ -306,6 +293,7 @@ virt_v2v_copy_to_local_DEPENDENCIES = \ ../common/mltools/mltools.$(MLARCHIVE) \ ../common/mllibvirt/mllibvirt.$(MLARCHIVE) \ ../common/mlcustomize/mlcustomize.$(MLARCHIVE) \ + ../common/mlv2v/mlv2v.$(MLARCHIVE) \ $(top_srcdir)/ocaml-link.sh virt_v2v_copy_to_local_LINK = \ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \ @@ -332,7 +320,6 @@ endif v2v_unit_tests_BOBJECTS = \ config.cmo \ types.cmo \ - uefi.cmo \ utils.cmo \ DOM.cmo \ create_ovf.cmo \ @@ -380,6 +367,7 @@ v2v_unit_tests_DEPENDENCIES = \ ../common/mlutils/mlcutils.$(MLARCHIVE) \ ../common/mltools/mltools.$(MLARCHIVE) \ ../common/mlcustomize/mlcustomize.$(MLARCHIVE) \ + ../common/mlv2v/mlv2v.$(MLARCHIVE) \ $(top_srcdir)/ocaml-link.sh v2v_unit_tests_LINK = \ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \ -- 2.23.0
Pino Toscano
2019-Dec-13 16:01 UTC
[Libguestfs] [v2v PATCH 4/7] build: do not ship generated sources
Exclude from EXTRA_DIST all the generated OCaml sources. --- v2v/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 63473515..b1ff8b2f 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -29,7 +29,7 @@ CONFIGURE_GENERATED_ML = \ EXTRA_DIST = \ $(SOURCES_MLI) \ - $(filter-out $(CONFIGURE_GENERATED_ML),$(SOURCES_ML)) \ + $(filter-out $(CONFIGURE_GENERATED_ML) $(BUILT_SOURCES),$(SOURCES_ML)) \ $(SOURCES_C) \ copy_to_local.ml \ copy_to_local.mli \ -- 2.23.0
Pino Toscano
2019-Dec-13 16:01 UTC
[Libguestfs] [v2v PATCH 5/7] build: drop HAVE_OCAML conditionals
OCaml is mandatory for virt-v2v. --- test-harness/Makefile.am | 4 ---- v2v/Makefile.am | 4 ---- 2 files changed, 8 deletions(-) diff --git a/test-harness/Makefile.am b/test-harness/Makefile.am index 157cee4f..11de6dc4 100644 --- a/test-harness/Makefile.am +++ b/test-harness/Makefile.am @@ -30,8 +30,6 @@ SOURCES_MLI = \ SOURCES_ML = \ v2v_test_harness.ml -if HAVE_OCAML - # -I $(top_builddir)/lib/.libs is a hack which forces corresponding -L # option to be passed to gcc, so we don't try linking against an # installed copy of libguestfs. @@ -125,6 +123,4 @@ stamp-virt-v2v-test-harness.pod: virt-v2v-test-harness.pod $(top_builddir)/ocaml-dep.sh -I .. $^ -include .depend -endif - .PHONY: docs diff --git a/v2v/Makefile.am b/v2v/Makefile.am index b1ff8b2f..23256d3b 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -177,8 +177,6 @@ output_rhv_upload_precheck_source.ml: $(srcdir)/rhv-upload-precheck.py output_rhv_upload_vmcheck_source.ml: $(srcdir)/rhv-upload-vmcheck.py $(srcdir)/embed.sh code $^ $@ -if HAVE_OCAML - bin_PROGRAMS = virt-v2v virt-v2v-copy-to-local virt_v2v_SOURCES = $(SOURCES_C) @@ -395,5 +393,3 @@ var_expander_tests_LINK = \ output_rhv_upload_*_source.ml $(top_builddir)/ocaml-dep.sh $^ -include .depend - -endif -- 2.23.0
Pino Toscano
2019-Dec-13 16:01 UTC
[Libguestfs] [v2v PATCH 6/7] build: actually require libvirt
libvirt was already a required component, so make the build system enforce that. --- m4/guestfs-libraries.m4 | 22 ++-------------------- tests/Makefile.am | 2 -- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4 index 41f3a975..bb5d75f6 100644 --- a/m4/guestfs-libraries.m4 +++ b/m4/guestfs-libraries.m4 @@ -80,26 +80,8 @@ PKG_CHECK_MODULES([PCRE], [libpcre], [], [ PCRE_LIBS=`$PCRE_CONFIG --libs` ]) -dnl libvirt (highly recommended) -AC_ARG_WITH([libvirt],[ - AS_HELP_STRING([--without-libvirt], - [disable libvirt support @<:@default=check@:>@])], - [], - [with_libvirt=check]) -AS_IF([test "$with_libvirt" != "no"],[ - PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 0.10.2],[ - AC_SUBST([LIBVIRT_CFLAGS]) - AC_SUBST([LIBVIRT_LIBS]) - AC_DEFINE([HAVE_LIBVIRT],[1],[libvirt found at compile time.]) - ],[ - if test "$DEFAULT_BACKEND" = "libvirt"; then - AC_MSG_ERROR([Please install the libvirt devel package]) - else - AC_MSG_WARN([libvirt not found, some core features will be disabled]) - fi - ]) -]) -AM_CONDITIONAL([HAVE_LIBVIRT],[test "x$LIBVIRT_LIBS" != "x"]) +dnl libvirt (required) +PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 0.10.2]) libvirt_ro_uri='qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock-ro' AC_SUBST([libvirt_ro_uri]) diff --git a/tests/Makefile.am b/tests/Makefile.am index 41fd24bf..0f004d19 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,7 +19,6 @@ include $(top_srcdir)/subdir-rules.mk EXTRA_DIST = test-functions.sh -if HAVE_LIBVIRT # Small utility to check for a needed libvirt version; # to be used in shell/script-based tests. noinst_PROGRAMS = libvirt-is-version @@ -36,7 +35,6 @@ libvirt_is_version_CPPFLAGS = \ libvirt_is_version_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ $(LIBVIRT_CFLAGS) -endif # Tests. -- 2.23.0
Pino Toscano
2019-Dec-13 16:01 UTC
[Libguestfs] [v2v PATCH 7/7] build: hopefully fix dependencies on generated files
Make sure to directly address them by name, as the wildcard will not work for non-existing files. --- v2v/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 23256d3b..48d3f515 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -389,7 +389,7 @@ var_expander_tests_LINK = \ .depend: \ $(srcdir)/*.mli \ $(srcdir)/*.ml \ - config.ml \ - output_rhv_upload_*_source.ml + $(CONFIGURE_GENERATED_ML) \ + $(filter %.ml,$(BUILT_SOURCES)) $(top_builddir)/ocaml-dep.sh $^ -include .depend -- 2.23.0
Richard W.M. Jones
2019-Dec-14 07:17 UTC
Re: [Libguestfs] [v2v PATCH 7/7] build: hopefully fix dependencies on generated files
ACK series, thanks. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v