v2v: -o rhv-upload: Allow configure to set the nbdkit Python version.

No functional change, but it does allow downstream distributions to
adjust the nbdkit Python plugin used by virt-v2v -o rhv-upload mode:

./configure --with-virt-v2v-nbdkit-python-plugin=...
This commit is contained in:
Richard W.M. Jones
2019-01-08 12:11:20 +00:00
parent 090f5589e7
commit 61b86bac2e
8 changed files with 86 additions and 1 deletions

1
.gitignore vendored
View File

@@ -678,6 +678,7 @@ Makefile.in
/utils/qemu-boot/qemu-boot
/utils/qemu-speed-test/qemu-speed-test
/v2v/.depend
/v2v/config.ml
/v2v/oUnit-*
/v2v/output_rhv_upload_*_source.ml
/v2v/real-*.d/

View File

@@ -354,6 +354,7 @@ po/POTFILES-ml: configure.ac
cd $(srcdir); \
find builder common/ml* customize dib get-kernel resize sparsify sysprep v2v -name '*.ml' | \
grep -v '^builder/templates/' | \
grep -v '^v2v/config.ml$$' | \
LC_ALL=C sort > $@-t
mv $@-t $@

View File

@@ -162,6 +162,10 @@ m4_include([m4/guestfs-golang.m4])
HEADING([Checking for GObject Introspection])
m4_include([m4/guestfs-gobject.m4])
dnl virt-v2v, virt-p2v.
HEADING([Checking the virt-v2v and virt-p2v dependencies])
m4_include([m4/guestfs-v2v.m4])
dnl Bash completion.
HEADING([Checking for bash completion])
m4_include([m4/guestfs-bash-completion.m4])
@@ -365,6 +369,7 @@ AC_CONFIG_FILES([Makefile
utils/qemu-boot/Makefile
utils/qemu-speed-test/Makefile
v2v/Makefile
v2v/config.ml
v2v/test-harness/Makefile
v2v/test-harness/META
website/index.html])

28
m4/guestfs-v2v.m4 Normal file
View File

@@ -0,0 +1,28 @@
# libguestfs
# Copyright (C) 2009-2019 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
dnl Virt-v2v and virt-p2v.
dnl nbdkit python plugin.
AC_MSG_CHECKING([for the nbdkit python plugin name])
AC_ARG_WITH([virt-v2v-nbdkit-python-plugin],
[AS_HELP_STRING([--with-virt-v2v-nbdkit-python-plugin="python|..."],
[set nbdkit python plugin name used by virt-v2v @<:@default=python@:>@])],
[VIRT_V2V_NBDKIT_PYTHON_PLUGIN="$withval"],
[VIRT_V2V_NBDKIT_PYTHON_PLUGIN=python])
AC_MSG_RESULT([$VIRT_V2V_NBDKIT_PYTHON_PLUGIN])
AC_SUBST([VIRT_V2V_NBDKIT_PYTHON_PLUGIN])

View File

@@ -23,6 +23,7 @@ generator_built = \
BUILT_SOURCES = \
$(generator_built) \
config.ml \
output_rhv_upload_createvm_source.ml \
output_rhv_upload_plugin_source.ml \
output_rhv_upload_precheck_source.ml
@@ -48,6 +49,7 @@ EXTRA_DIST = \
SOURCES_MLI = \
changeuid.mli \
cmdline.mli \
config.mli \
convert_linux.mli \
convert_windows.mli \
create_libvirt_xml.mli \
@@ -100,6 +102,7 @@ SOURCES_MLI = \
windows_virtio.mli
SOURCES_ML = \
config.ml \
types.ml \
uefi.ml \
utils.ml \
@@ -697,6 +700,7 @@ v2v_unit_tests_LINK = \
.depend: \
$(srcdir)/*.mli \
$(srcdir)/*.ml \
config.ml \
output_rhv_upload_*_source.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend

20
v2v/config.ml.in Normal file
View File

@@ -0,0 +1,20 @@
(* virt-v2v
* Copyright (C) 2019 Red Hat Inc.
* @configure_input@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*)
let virt_v2v_nbdkit_python_plugin = "@VIRT_V2V_NBDKIT_PYTHON_PLUGIN@"

26
v2v/config.mli Normal file
View File

@@ -0,0 +1,26 @@
(* virt-v2v
* Copyright (C) 2019 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*)
val virt_v2v_nbdkit_python_plugin : string
(** Return the name of the nbdkit python plugin used by
[virt-v2v -o rhv-upload].
As above this must also be the Python 3 version of the plugin,
unless you change it. The configure command to change this is:
[./configure --with-virt-v2v-nbdkit-python-plugin=...] *)

View File

@@ -78,7 +78,7 @@ let parse_output_options options =
{ rhv_cafile; rhv_cluster; rhv_direct; rhv_verifypeer }
let nbdkit_python_plugin = "python"
let nbdkit_python_plugin = Config.virt_v2v_nbdkit_python_plugin
let pidfile_timeout = 30
let finalization_timeout = 5*60