40 Commits

Author SHA1 Message Date
Richard W.M. Jones
ade62ebdb5 v2v: Add support for virt-customize options
For higher level tools making further arbitrary changes to the guest
post-conversion, especially adding more firstboot scripts, it's useful
if we have various features from virt-customize.  Particularly the
ability to upload and run scripts.  Since we have the virt-customize
code in the common/ submodule, the easiest thing to do is to add the
virt-customize options, the same way it is done in virt-builder and
virt-sysprep.

Also updates the common submodule to get:

Richard W.M. Jones (1):
      mlcustomize: Move virt-customize modules to mlcustomize/
2024-08-20 11:46:31 +01:00
Richard W.M. Jones
aafcd0d114 build: Document that nbdinfo and nbdcopy are required, and check
Update README to document that these tools have been needed (ever
since virt-v2v 2.0), and update ./configure to check it.
2024-01-18 17:33:47 +00:00
Richard W.M. Jones
970d7123c2 input/ssh: Use nbdinfo --can connect (instead of --size)
nbdinfo --size prints the size on stdout, causing it to appear in
virt-v2v output.  Using --can connect instead is silent.

Note that nbdinfo --can connect was added in libnbd 1.9.2 (Jul 2021)
and our previous minimum version of libnbd was 1.9.3 so we're OK.
However since neither of these was a stable version I also updated the
minimum libnbd requirement to 1.10 (Sep 2021), and added a proper
check in ./configure

Fixes: commit fb72e059863a60503b6011b8590c25c3a010a58f
2024-01-18 17:25:25 +00:00
Richard W.M. Jones
f046bb91b2 Replace Pervasives.* with Stdlib.*
Since OCaml 4.07 (released 2018-07-10) the always-loaded standard
library module has been called Stdlib.  The old Pervasives module was
finally removed in OCaml 5.

$ perl -pi.bak -e 's/Pervasives\./Stdlib./g' -- `git ls-files`

OCaml >= 4.07 is now required.

Also update the common submodule with:

  commit d61cd820b49e403848d15c5deaccbf8dd7045370
  Author: Jürgen Hötzel
  Date:   Sat May 20 18:16:40 2023 +0200

    Add support for OCaml 5.0
2023-05-22 17:25:40 +01:00
Richard W.M. Jones
89755763e4 m4: Move libosinfo detection
This simply makes it consistent with guestfs-tools.  There is no real
change here.
2023-01-16 17:18:37 +00:00
Richard W.M. Jones
c3769ffa2a valgrind: Remove --show-leak-kinds=all
In commit 1e0d615a88 ("build: Don't write valgrind log files to tmp/
directory") I added this option without really thinking too much about
it.  However it makes the output of valgrind much harder to read
because it includes many traces which are not counted as true leaks.

Fixes: commit 1e0d615a883e4056b757d041a1ad1bbd39df3b3c
2022-10-11 12:33:23 +01:00
Richard W.M. Jones
b6016c79ad configure: Use AC_FUNC_STRERROR_R
Update common submodule to include modified strerror_r replacement

(cherry picked from libguestfs commit df5805df6336e3cc82671c4da6e72bd9e5722ec8)
2022-08-16 14:20:34 +01:00
Richard W.M. Jones
3c4505c12a build: Remove bundled OCaml bindings for libvirt
The ocaml-libvirt project (https://gitlab.com/libvirt/libvirt-ocaml)
provides bindings for libvirt.  For historical reasons we bundled this
as it was throught ocaml-libvirt wasn't widespread on distros.  In
fact Fedora and Debian derivatives all have this.  Arch does not
(yet), but we can fix that.

It said in the README file in that directory, "before virt-v2v 1.42 is
released we hope to have unbundled this".  That didn't happen, but
let's remove it now.
2022-04-28 15:42:26 +01:00
Richard W.M. Jones
f6108bbd66 build: No longer check for ocamldep -one-line and -all options
These were added to ocamldep in Jan 2012, over 10 years ago.  They
were not present in RHEL 6, but we don't care about that now.
2022-04-28 15:34:22 +01:00
Richard W.M. Jones
1e0d615a88 build: Don't write valgrind log files to tmp/ directory
Inherited from libguestfs, we wrote valgrind log files into the tmp/
directory during tests.  However this makes it very difficult to
connect a particular log file to a particular failing test.  As with
nbdkit let's just write the valgrind output to stderr, where it will
end up in the test log file (ie. tests/test-suite.log or tests/*.log).

I also adjusted the valgrind parameters so they more closely match
those used by nbdkit.
2022-04-12 11:38:18 +01:00
Laszlo Ersek
23b80a28d8 m4: require libguestfs >= 1.44
The next libguestfs-common submodule update will assume
GUESTFS_HAVE_LUKS_UUID and GUESTFS_HAVE_CRYPTSETUP_OPEN;
guestfs_cryptsetup_open() is available starting with libguestfs-1.44.

Suggested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20220228155717.18077-1-lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
2022-03-01 17:35:04 +01:00
Richard W.M. Jones
9bb0e7f1d2 Disable OCaml warning 6 completely
Warning 6 "labels-omitted" is not useful.  It's fine to omit labels on
positional arguments.

Example:

  File "perl_edit.ml", line 30, characters 2-13:
  30 |   c_edit_file (verbose ()) g (Guestfs.c_pointer g) file expr
         ^^^^^^^^^^^
  Warning 6 [labels-omitted]: label verbose was omitted in the application of this function.

The function is specified as:

  external c_edit_file : verbose:bool -> Guestfs.t -> int64 -> string -> string -> unit

The complaint is that the verbose: label has been omitted from the
first argument when the function is called, but IMO this is a
stylistic thing, not a bug.

(cherry picked from
guestfs-tools commit 577f7aee4b1c720f4c4826115b49a0c3870b149e)
2021-12-10 10:30:39 +00:00
Richard W.M. Jones
ec17cb3227 customize: Suppress OCaml warning
In OCaml 4.13:

File "perl_edit.ml", line 30, characters 2-13:
30 |   c_edit_file (verbose ()) g (Guestfs.c_pointer g) file expr
       ^^^^^^^^^^^
Error (warning 6 [labels-omitted]): label verbose was omitted in the application of this function.

(cherry picked from
guestfs-tools commit a4930f5fad82e5358d565b8cf3610970e9646259)
2021-12-10 10:30:30 +00:00
Richard W.M. Jones
7a93451623 Move minimum OCaml version to 4.04.
Synchronize with common module which also requires 4.04.

Small adjustment to use of List.sort_uniq because the signature
changed slightly.
2021-11-09 10:20:04 +00:00
Richard W.M. Jones
e3dcf9c101 m4: Remove test for OCaml Bytes module
This has been in OCaml since 4.02, and we've required 4.02 for a long
time (and now require 4.03).  In any case the result of the test is no
longer used anywhere so the test was redundant.
2021-11-09 10:09:43 +00:00
Laszlo Ersek
7ce5df273b build: fix typo in "--enable-werror" help string
Fixes: af9251086030886580cd5243afabf726d5e50fdc
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20211012160824.8488-1-lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
2021-10-13 12:33:29 +02:00
Richard W.M. Jones
69241dc4ad m4/guestfs-ocaml.m4: Fix deprecated warning format
In OCaml 4.13:

Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters,
like 'CDEFLMPSUVYZX', is deprecated.
Use the equivalent signed form: +C+D+E+F+L+M+P+S+U+V+Y+Z+X+52-3.

(cherry picked from
guestfs-tools commit fa4f59e1d99c08d7e0bae2a7cb54f254a6506d67)
2021-10-05 21:00:23 +01:00
Richard W.M. Jones
255722cbf3 v2v: Modular virt-v2v
Split virt-v2v into several cooperating helper programs.  Use disk
image pipelines on both the input and output sides even when accessing
local files.  Expose the NBD sockets.  Use nbdcopy for the copy step.
Some features have been removed and we intend to add those back later
(see TODO file).

For the original plan to split virt-v2v, see:
https://listman.redhat.com/archives/libguestfs/2020-November/msg00022.html

Thanks: Ming Xie, Tingting Zheng, Nir Soffer, Eric Blake, Martin Kletzander

This change is made up of many separate commits done during
development.  The history of those commit messages is preserved below,
but the individual commits do not make too much sense so they have
been squashed into a single large change.

v2v: Move library-ish parts of virt-v2v into lib/ subdirectory

In preparation for splitting virt-v2v, moving library-ish parts of the
code that we wish to reuse in the new helpers into the lib/
subdirectory.

This is neutral code refactoring.

lib: Define format for metadata

In a previous iteration of the virt-v2v split I proposed using an open
format for metadata such as XML, and actually implemented much of it.

However to keep this change simple, and because no one except us is
supposed to be generating or consuming this metadata, this commit
replaces the open format with a simple OCaml serialization of an
opaque version string + the struct (eg. Types.sources).  The opaque
version string is there to ensure binary compatibility between the
helpers and to discourage people from trying to write or consume the
metadata.

Note: The metadata is not ABI and will change arbitrarily between
releases.  If you need to write or consume the metadata it's best to
talk to us about what you're trying to do.

inputs: Create helper-v2v-input-disk

As part of splitting up virt-v2v create input helpers.  This is the
first and simplest input helper which implements the “virt-v2v -i disk”
functionality, ie. being able to drive virt-v2v from a local disk file
without any metadata.

For further details on the virt-v2v split, refer to this plan:
https://listman.redhat.com/archives/libguestfs/2020-November/msg00022.html

outputs: Create helper-v2v-output-disk

This is the simplest possible output helper.  It creates the output
disks (really: processes and sockets).  Note this does not yet create
the final libvirt XML.  This will be added in a later commit.

convert: Create helper-v2v-convert

This commit moves the conversion code into a separate helper program
(helper-v2v-convert) which performs the conversion on the input disks.
The input disks are actually COW overlays over the source disks so
that nothing is changed on the source.

This step creates metadata files: guestcaps, inspect, target_buses and
target_firmware corresponding to the internal data structures.  These
will be consumed by the output finalization step.

v2v: Get rid of Modules_list

This functionality will be replaced in the new virt-v2v.

v2v: Rearrange sources into input/ and output/ directories

Rearrange sources for incomplete input and output drivers into the new
directories.

lib: Remove unused input and output objects

These objects are no longer required after creating the modular input
and output helpers.

lib/nbdkit.ml: Add LANG=C for all nbdkit instances

In old virt-v2v this was added through the Nbdkit_sources module to
all instances of nbdkit.  Add it unconditionally through Nbdkit module
to get the same effect.

outputs: Create helper-v2v-output-null

This handles -o null conversions.

v2v: Add new virt-v2v command line parser and program

In the newly modular virt-v2v, this program is responsible for
handling compatibility with the old virt-v2v command line.  It will
continue to be the main way that people use virt-v2v for the
foreseeable future.  This program starts the helper programs and
handles multiplexing of virt-v2v command line parameters to the right
helper.

docs, tests: Adjust --no-copy documentation and tests

Since copying and creating the output are now handled in separate
programs, --no-copy will usually create the output disks (but empty).
Adjust documentation and tests accordingly.

It's probably better to remove this option.

inputs: Create helper-v2v-input-libvirt

This handles "-i libvirtxml" (input from libvirt XML file), and all
"-i libvirt" cases which are not handled by more specific code
(ie. not vcenter-https, not vddk, not xen-ssh).

outputs: Finish finalization code for helper-v2v-output-disk

Create the final libvirt XML.

lib, tests: Don't print unused field in source_disk, fix test.

lib: Remove unused fields in s_disks struct

The fields s_qemu_uri and s_format were no longer used, remove them.

inputs: Create helper-v2v-input-ova

This handles parsing OVA files (-i ova).

outputs: Create helper-v2v-output-glance

This implements -o glance conversions to OpenStack Glance.

outputs: Create helper-v2v-output-json

Implements -o json mode.

outputs: Create helper-v2v-output-qemu

Implements -o qemu mode.

tests/test-v2v-bad-networks-and-bridges.sh: Fix test

This test depended on the specifics of parameter parsing and errors.
Adjust the test so it works with modular virt-v2v.

inputs: Combine all input helpers into one program.

This reduces the duplication of code from the previous plan.  There is
now a single helper, and it uses a "hidden" -im parameter (passed by
virt-v2v) to select the input mode, eg:

  helper-v2v-input -im libvirtxml v2vdir xmlfile

outputs: Combine all output helpers into one program.

This reduces duplication of code.  There is now a single helper, and
it uses a "hidden" -om parameter (passed by virt-v2v) to select the
output mode, eg:

  helper-v2v-output -om disk setup v2vdir -os /storage

outputs: Implement -o libvirt

inputs: Implement input from vcenter over HTTPS

This implements virt-v2v -i libvirt when we detect that the libvirt
URI points to a VMware server over HTTPS (without using VDDK).

inputs: Implement input from VMware using VDDK

This implements -i libvirt -it vddk.

inputs: Implement input from VMware via VMX

This implements -i vmx.

v2v: Fix -io ? and -oo ?

inputs: Implement input from Xen over SSH

input: Refactor input helper

Now that we have moved all the input-side code from old virt-v2v,
refactor and generally clean up.

output: Refactor output helper

General refactoring and clean up to improve the quality of the code in
the output helper.

outputs: Implement -o openstack

outputs: Implement -o rhv and -o vdsm

outputs: Implement -o rhv-upload

v2v: Run helpers with --program-name=virt-v2v

This means the helpers will use "virt-v2v" instead of "helper-v2v-..."
in error messages and similar, hopefully reducing confusion.

convert, output: Improve consistency of error messages

Don't use "prog" usually since it is added by the error function.
However occasionally when there's an internal error with virt-v2v
using the wrong arguments to the helper then we can use prog to
display the actual helper having problems.

inputs, outputs: Add cmdline abstract type

Convenient way to pass the multiple command line options as a single
parameter to functions.  This is simple refactoring to make the next
change possible.

inputs, outputs: Give an error for invalid option combinations

virt-v2v 1.4x was fussy about reporting errors for options which were
not applicable in certain input or output modes.  Replicate that as
much as possible here.  Old virt-v2v checked output modes more
thoroughly than input modes, and I have stuck with copying that
behaviour.

This also corrects an error in -o libvirt: In old virt-v2v the output
pool defaulted to "default" rather than giving an error.

inputs, outputs: Choose qemu-nbd PID file named based on socket

Previously we attempted to choose the PID file name randomly.
Although this should never conflict, I saw one case where qemu-nbd
failed to start up, printing only:

  qemu-nbd: Cannot lock pid file: Resource temporarily unavailable

My reading of the code is this could be caused by the PID file already
being locked.

Anyway there is a better way to choose PID file names: simply extend
the already unique socket name with ".pid".

v2v: Don't print double error messages

If running helper-v2v-* programs, assume that if these exit on error
then they have already printed an error message.  Therefore the main
virt-v2v program does not need to print another error message.

v2v: Set permissions and SELinux labels on all sockets

When running virt-v2v as non-root (the recommended way) this all
worked fine before.

However a problem arises when running virt-v2v as root.  Libvirt will
run qemu as a non-root user, so we need to set permissions
appropriately (ironically making everything a bit less secure).

Also set SELinux labels if we detect SELinux is being used.

Reported-by: Tingting Zheng

output: Explicitly shut down the NBD handle

This avoids a warning from qemu-nbd:

qemu-nbd: Disconnect client, due to: Failed to send reply: Unable to write to socket: Broken pipe

For more information about the warning, see:

https://lists.nongnu.org/archive/html/qemu-block/2021-07/msg00703.html

lib/nbdkit: Always set both socket and file labels when using SELinux

We always set the file permissions to 0777 so we might as well always
set the SELinux labels when we detect that we are using SELinux.  This
avoids complexity elsewhere in virt-v2v.

inputs, outputs: Label all qemu-nbd sockets when using SELinux

Abstract qemu-nbd into a data type

Add a new module QemuNBD which contains the common code for running
qemu-nbd.  Replace existing code in the input and output helpers with
this module.

v2v: In verbose mode, dump nbdinfo about each NBD socket

This could help with debugging, especially understanding if nbdcopy
can use multi-conn.

input: Use the cache filter (if available) with slow plugins

This adds the cache filter to the chain of filters for slow plugins
(curl, ssh, vddk).

There is a potential further enhancement here: using conditional
cache-on-read=/path.  However that requires a very new nbdkit and
further changes elsewhere in virt-v2v.

input/nbdkit: Refactor these modules

These modules were made from old virt-v2v by splitting up the old
Nbdkit_sources module, but otherwise the code was virtually
unmodified.  This refactoring eliminates code duplication and dead
code left over from the split.

Although this is mostly refactoring, I also got rid of the ability to
use nbdkit-vddk-plugin < 1.17.10, which required the awkward use to
LD_LIBRARY_PATH.

convert: Do not use qemu block layer copyonread

Before this change:

[   0.0] Opening the source
[ 145.6] Inspecting the source
[ 988.4] Checking for sufficient free disk space in the guest
[ 988.4] Converting Fedora 28 (Server Edition) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[3892.1] Mapping filesystem data to avoid copying unused and blank areas
[4125.9] Closing the overlay
[4126.6] Assigning disks to buses
[4126.6] Checking if the guest needs BIOS or UEFI to boot
[4126.6] Creating output metadata
[4132.8] Copying disk 1/1
█ 100% [****************************************]
[4205.1] Creating output metadata
[4205.1] Finishing off

After this change:

[   0.0] Opening the source
[   8.4] Inspecting the source
[  14.1] Checking for sufficient free disk space in the guest
[  14.1] Converting Fedora 28 (Server Edition) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  83.5] Mapping filesystem data to avoid copying unused and blank areas
[  87.2] Closing the overlay
[  87.9] Assigning disks to buses
[  87.9] Checking if the guest needs BIOS or UEFI to boot
[  87.9] Creating output metadata
[  94.0] Copying disk 1/1
█ 100% [****************************************]
[ 165.7] Creating output metadata
[ 165.7] Finishing off

We are now faster than virt-v2v 1.45:

[   0.0] Opening the source -i libvirt [...]
[   1.4] Creating an overlay to protect the source from being modified
[   4.8] Opening the overlay
[  17.2] Inspecting the overlay
[  23.7] Checking for sufficient free disk space in the guest
[  23.7] Converting Fedora 28 (Server Edition) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 110.0] Mapping filesystem data to avoid copying unused and blank areas
[ 124.5] Closing the overlay
[ 125.1] Assigning disks to buses
[ 125.1] Checking if the guest needs BIOS or UEFI to boot
[ 125.1] Initializing the target -o null
[ 125.2] Copying disk 1/1 to qemu URI json:{ "file.driver": "null-co", "file.size": "1E" } (raw)
    (100.00/100%)
[ 764.6] Creating output metadata
[ 764.6] Finishing off

Thanks: Peter Krempa

v2v: Write dir/convert and dir/copy files

During the conversion and copying phases, write files literally called
"convert" and "copy" into the v2v directory.  Helpers can use these to
make decisions based on the phase of virt-v2v.  In particular we will
use the presence of the "convert" file to determine if we need to
enable copy-on-read.

input: Implement nbdkit-cow-filter cow-on-read (copy on read)

This has considerable performance benefits during the conversion step.

See also:
https://listman.redhat.com/archives/libguestfs/2021-July/msg00054.html

Add list of requirements to the README

todo: Put some items left over from modularization on the backlog

input: -i disk: Always detect input format

If the input format is raw, prefer nbdkit.

v2v: Minor refactoring of the code that runs nbdcopy

convert: Remove bogus "Creating output metadata" message

Left over from virt-v2v 1.45
2021-09-07 11:24:03 +01:00
Richard W.M. Jones
e054a0ee9c m4/guestfs-find-db-tool.m4: Remove unused file.
Fixes: commit 10d783605cd2f403eaa096a0b81d3cff1994c119
2021-04-14 12:30:27 +01:00
Richard W.M. Jones
af92510860 build: Remove gnulib submodule. 2021-04-14 12:30:27 +01:00
Richard W.M. Jones
7a346548c0 tests: Prefer xorriso over genisoimage to generate test.iso
This Debian page explains the upstream situation:
https://wiki.debian.org/genisoimage

On Fedora, xorriso provides a compatibility program called "mkisofs".
However this is not present in Debian.  Hence the choice to look for
the program called "xorrisofs".

(cherry picked from commit 2216ab2e328457ef172d6bfa534272edf2f81a3a)
2021-03-31 20:12:52 +01:00
Richard W.M. Jones
10d783605c test-data/phony-guests: Fix phony RPM database, fix virt-inspector test.
libguestfs 1.45.3 now reads the RPM database using librpm, which means
our old phony database created by db_dump can no longer work.  Instead
provide a real (but very minimal) sqlite database.

This commit also fixes the virt-inspector test since the RPM database
contents are now different.
2021-03-29 17:30:42 +01:00
Richard W.M. Jones
3c66709e3c build: Use correct ounit2 OCaml module.
Also update common module to get the same fix.
2021-03-25 08:28:01 +00:00
Richard W.M. Jones
ab825d5e13 Port virt-v2v to use pcre2 instead of pcre. 2021-03-16 15:12:29 +00:00
Pino Toscano
c78359deeb po-docs: split pot and po handling
With the Weblate adoption, we let it update the po files from the
catalog template. The po4a behaviour of extracting the template,
merging the existing translations, and creating the translated PODs at
once is problematic. Hence, split the extraction and the translated POD
generation in two.

Use po4a-gettextize to extract the catalog template only, not doing it
anymore automatically at each build. There is no more need for a
po4a.conf file.

Use po4a-translate to create translated PODs from the po files, keeping
the fixup of the generated files (to avoid spurious =encoding, etc).
Add a silent rule to hide the po4a-translate command lines by default.

These changes also allow us to get rid of the POD existance checks with
associated error message pointing to the update-po rule. Now each
translated POD file is generated because of make dependency, and it
depends only on its po file.
2020-08-13 12:55:51 +02:00
Richard W.M. Jones
cc294b7735 Update gnulib to latest. 2020-04-14 11:57:37 +01:00
Richard W.M. Jones
6f7abd5692 build: Use libtool instead of $(LIBTOOL) in VG macro.
In commit 5f355c2952729581f1b988297fe8cabe756c01e2 I incorrectly
rewrote ‘libtool’ from the original libguestfs file as ‘$(LIBTOOL)’.

This was because of a comment that appears in the libguestfs file:

  Note we run libtool, not $(LIBTOOL) since the latter expands to
  libtool-kill-dependency-libs.sh

Since virt-v2v doesn't have libtool-kill-dependency-libs.sh, I
reasoned that we should change libtool back to $(LIBTOOL) and remove
the comment.

However the result of this was wrong.  $(LIBTOOL) expands to
$(top_builddir)/libtool, but this breaks (because of the relative
path) whenever the VG macro is used within pushd...popd pairs, as
happens in several tests.

Restoring the libguestfs version fixes this.
2020-04-14 10:37:05 +01:00
Richard W.M. Jones
8cf4488d6b build: Check for Perl Sys::Guestfs, needed to run the tests.
Also remove a bogus comment - we already check for the
OCaml guestfs module.
2020-04-02 13:21:53 +01:00
Richard W.M. Jones
9a3a71bc8b Change a few libguestfs -> virt-v2v and update copyright dates. 2020-04-02 13:21:53 +01:00
Pino Toscano
fd0bf24241 build: require libosinfo
Require libosinfo for virt-v2v, as it will be used soon to get more
information on guests.
2020-02-14 14:36:59 +01:00
Richard W.M. Jones
65353e7aae ocaml: Use caml_alloc_initialized_string instead of memcpy.
See this commit in libguestfs-common:
398dc56a6c
2020-02-06 10:26:13 +00:00
Richard W.M. Jones
83a35f927a m4: ocaml: Remove HIVEX_OPEN_UNSAFE_FLAG.
The test for this was missing, so it was always defined wrongly.  In
any case nothing in libguestfs-common or virt-v2v actually uses this
flag (it's used by the libguestfs daemon) so the code was dead.
2020-02-06 10:20:34 +00:00
Richard W.M. Jones
2a0fb45f5f ocaml: Fix test for -runtime-variant _pic.
This fails with Fedora 32, and possibly earlier versions:

  checking if OCaml ‘-runtime-variant _pic’ works... no

The reason is:

  $ ocamlc -runtime-variant _pic test.ml -o test
  File "test.ml", line 1:
  Error: Cannot find file camlheader_pic

which may even be a packaging error in the Fedora package.  However it
makes no sense to test the bytecode compiler since we don't use it on
any architecture we care about and bytecode doesn't even contain a
linked runtime.  Changing the test to use ocamlopt instead of ocamlc
fixes the problem.

(cherry picked from
libguestfs commit 711fab172ca2b2cad5d91636cd408dcefc5cea44)
2020-01-15 12:56:57 +00:00
Pino Toscano
1f0fce52a6 Revamp check for Python code style
It turns out that
a) the standalone pep8 executable is deprecated in favour of pycodestyle
b) $python-pep8 does not exist in modern distros
and thus the style checks for Python scripts have been skipped for a
long time.

Instead, switch to pycodestyle directly, updating the list of ignored
issues to the two categories left.
2020-01-10 16:44:41 +01:00
Pino Toscano
b092b7fbd6 build: actually require libvirt
libvirt was already a required component, so make the build system
enforce that.
2019-12-13 16:50:55 +01:00
Pino Toscano
db9aeeef59 build: remove extra checks and submodules
Remove various redundant checks for headers, functions, libraries,
tools, and other stuff not actually used neither by virt-v2v nor by its
submodules from common.

Also, stop building the mlaugeas, and windows submodules, as they are
not used.
2019-11-27 15:31:19 +01:00
Richard W.M. Jones
fffa7732c5 m4: Relax dependency on libguestfs versions.
1.41 was only required to run a single test, but in all other respects
1.40 works fine.  Relax the dependency and fix the test instead.

Thanks: Nir Soffer.
2019-11-18 10:09:21 +00:00
Richard W.M. Jones
8cab32c0eb m4: Remove daemon checks and dependency on hivex.
Now that we've split out virt-v2v, there's no daemon, and hivex is not
required (since it is only used through the guestfs API).
2019-11-18 09:46:26 +00:00
Richard W.M. Jones
48afc3b004 m4: Check that ocaml 'guestfs' module is available.
It is required to compile virt-v2v after we split out libguestfs and
virt-v2v.

Thanks: Nir Soffer.
2019-11-18 09:44:12 +00:00
Richard W.M. Jones
5f355c2952 Add back basic build environment.
Largely copied from original libguestfs.git.
2019-10-16 17:38:14 +01:00