Allow the tests to be run on the installed libguestfs.so library and
on installed programs (but not installed language bindings, yet).
To run the tests, you have to have a copy of the libguestfs source
tree with exactly the same version as the installed libguestfs. You
have to build the libguestfs source tree. Then you do:
make installcheck
I investigated making automake 'make installcheck' work, but it's
basically broken (no surprise there).
This is derived from the old 'make-check-on-installed.pl'
script (which is also removed in this patch).
If either zcat or cpio fails when spawned in initrd-list, pclose will
return the actual return value of it, but reply_with_perror still uses
errno regardless; thus, the reported error is:
libguestfs: error: initrd_list: pclose: Success
which is not much helpful.
Instead, when pclose returns > 0, extract the actual return value of the
subprocess, and print that. Thus now we get for example:
libguestfs: error: initrd_list: pclose: command failed with return code 1
It's currently impossible to correctly predict the dcPath parameter
from the data that libvirt gives us. So allow the user to override
--dcpath themselves.
Eventually we will get better support in libvirt for this, and this
option will no longer be needed:
https://www.redhat.com/archives/libvir-list/2015-September/thread.html#00201
This enhances commit 51bc573d0c
and commit 20f1eb400b.
If a Linux guest has /etc/os-release (mandatory for systemd, so all the
recent Linux distributions have it), try to parse it for the distro, its
version, and its product name. If we cannot get all of them, the
detection as done so far continues.
Other than changes in the product_name string (which is free-form
anyway, and already documented to not be parseable), there should be no
regressions in the detected distro and version.
Filter out from the git ls-files output the files we don't care they
appeared (gnulib and intltools stuff), and use comm to only show the
remaining added files (i.e. files not being distributed).
The output of comm is redirected to file and then printed, so we can
check it is empty (failing the target if not).
Add a new "simplestreams" repository type, and a simple parser for
fetching and reading the JSON indexes of the Simple Streams v1.0
format.
Read only datatype=image-downloads contents, and only the latest
versions of each content available as disk image (disk.img or
disk1.img).
Add a simple test, using the "released" images from the CirrOS project.
Check if the Windows guest has Group Policy Objects installed, or one
of several popular pieces of anti-virus software. If we are
installing a virtio block driver, then experience has shown this may
cause a 7B boot failure.
Print a warning when this combination happens.
The warnings look like this:
[ 19.9] Converting Windows Server 2008 R2 Enterprise to run on KVM
virt-v2v: warning: this guest has Windows Group Policy Objects (GPO) and a
new virtio block device driver was installed. In some circumstances, Group
Policy may prevent new drivers from working (resulting in a 7B boot error).
If this happens, try disabling Group Policy before doing the conversion.
virt-v2v: warning: this guest has Anti-Virus (AV) software and a new virtio
block device driver was installed. In some circumstances, AV may prevent
new drivers from working (resulting in a 7B boot error). If this happens,
try disabling AV before doing the conversion.
virt-v2v: This guest has virtio drivers installed.
Change the handling of -ic, -if, -oc, -of, -on, -os, --password-file,
--vdsm-vm-uuid, --vdsm-ovf-output, --vmtype options, so that if any
appear multiple times on the command line we error out:
$ virt-v2v -i disk /tmp/centos-6.img -o null -of qcow2 -of raw
virt-v2v: error: -of option used more than once on the command line
Thanks: Juquin Zhou for finding the bug.
Turns out that some of the Windows guests in the test suite try to
reactivate if the date is more than some time delta (maybe 1 year?)
after the previous activation. Just disabling the network wasn't
enough to prevent this.
qemu allows us to boot guests with the clock set to a particular date
in the past, and libvirt exposes this (albeit very clumsily):
https://docs.fedoraproject.org/en-US/Fedora/18/html/Virtualization_Administration_Guide/sect-Virtualization-Tips_and_tricks-Libvirt_Managed_Timers.html
Allow guests to be booted with the date set to a particular past date,
by setting the test_plan.guest_clock field.
This required adding some more libxml2 bindings.
When calling test_connection to test the connection to a conversion
server, we also query for the remote server's version and driver
information (using 'virt-v2v --version' and
'virt-v2v --machine-readable').
However we didn't clear the existing information from previous runs.
One consequence of this was that if you used the back button in the
GUI, the list of output drivers would be repopulated two or more
times. https://bugzilla.redhat.com/show_bug.cgi?id=1227609
Another is that connecting to a different server could confuse
test_connection into thinking the connection was successful (because
of data from the previous run) when in fact it was not.
Thanks: Tingting Zheng for finding the original bug.
Split in an own function the code dong the mounting, the inspection of
the kernel files, and the downloading, including a per-OS function for
the actual kernel files. This gives few advantages:
- the download phease is not repeated for all the files to fetch
- it is easier to eventually support multi-root disk images
- it is possible to support OSes different than Linux; virt-get-kernel
now will just report the unsupported OS, instead of a generic
"no kernel found" message
This is mostly code refactoring, with (on Linux) no actual behaviour
change.
Make print_version_and_exit, long_options, display_short_options, and
display_long_options private, as set_standard_options now takes care of
handling the job for the common command line options.
Move --debug-gc as common option for all the OCaml-based tools, even a
couple of them which didn't have it previously.
As implementation note, make set_debug_gc private to
set_standard_options, as it needed to be moved otherwise, and it is no
more required as public function.
Introduce a new common helper to add the common options for libguestfs
tools (short/long options, version, verbose, trace), and sort them.
All the OCaml-based tools had these options already, so there are no
functional changes in the interface they provide.
The only difference is that now the options are always sorted, while
some tools didn't had them like that previously: because of this, a
couple of ditto markers (as descriptions) don't match what's above them
anymore, and thus their full description is put instead.