Commit Graph

8295 Commits

Author SHA1 Message Date
Richard W.M. Jones
f2540d68e4 Add 'make installcheck' rule to test installed packages.
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).
2015-09-18 14:12:17 +01:00
Pino Toscano
59a9101e44 daemon: initrd: print return value from failing process
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
2015-09-15 10:19:58 +02:00
Richard W.M. Jones
e102bcf3cf perl: Set program name to the true name instead of 'perl'.
Currently any Perl program has the handle program name field set
to 'perl'.  Set it to the true name (derived from $0).
2015-09-13 13:45:32 +01:00
Shahar Lev
1b856a20ba v2v: fix provides list whitespace trim
Tabs should not be doubly-escaped in regexp.

Signed-off-by: Shahar Lev <shahar@stratoscale.com>
2015-09-13 11:47:52 +01:00
Richard W.M. Jones
7fb21afff6 Version 1.31.6. 1.31.6 2015-09-11 15:28:39 +01:00
Richard W.M. Jones
edcd02a965 launch: libvirt: Better error when bridge / virbr0 doesn't exist (RHBZ#1262127).
The current diagnostic is terrible.  This one tells the user how to
diagnose and fix the problem.
2015-09-10 23:06:20 +01:00
Richard W.M. Jones
0ed3855098 v2v: Add --dcpath parameter to allow dcPath to be overridden (RHBZ#1256823).
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.
2015-09-10 12:38:56 +01:00
Pino Toscano
1b8dd2150b builder: fix prototype virt_builder_yajl_tree_parse
Declare the prototype depending whether libyajl is available, and if it
isn't add also the noreturn attribute.

Fixes commit 87a42174f9.
2015-09-10 11:12:53 +02:00
Pino Toscano
32d19e3289 inspect: try to use /etc/os-release on Linux guests
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.
2015-09-09 16:17:59 +02:00
Richard W.M. Jones
e3aee9c14d v2v: -o rhev, -o vdsm: Set DefaultDisplayType back to 1 (RHBZ#1260590).
In commit c4bc8116d9, the DefaultDisplayType
was changed from 1 -> 2.  However this is in fact wrong.  See
https://bugzilla.redhat.com/show_bug.cgi?id=1260590#c17 for details.

This reverts the code back to what it was in
commit 829e3fe7a6.

Thanks: Omer Frenkel
2015-09-09 13:47:19 +01:00
Richard W.M. Jones
d68be534ea v2v: Detect AVG Technologies as AV software (RHBZ#1261436).
Thanks: Junqin Zhou
2015-09-09 13:33:12 +01:00
Richard W.M. Jones
6734fce8c8 v2v: Move anti-virus (AV) detection code to a separate module.
This is just code refactoring of earlier
commit 8e28d6b188.
2015-09-09 13:33:12 +01:00
Pino Toscano
27becc7e2f builder: handle output filenames with ':'
Use qemu_input_filename for the output file in the qemu-img convert
invocation.

See also commit 1709263613 for
virt-sparsify.
2015-09-09 13:19:57 +02:00
Pino Toscano
87a42174f9 builder: add noreturn for yajl functions without libyajl
caml_invalid_argument will not return, and GCC warns (or errors out with
-Werror) when the function is not marked as such.
2015-09-09 10:50:01 +02:00
Pino Toscano
1b4c1d74d3 customize: password: use SHA-512 on openSUSE >= 11.0
openSUSE 11.0 has glibc 2.8, which supports the SHA-512 method.
Fallback to an explicit MD5 for older versions.
2015-09-08 19:07:23 +02:00
Pino Toscano
f788b3c48d inspect: recognize the Frugalware distribution
Just basic identification, name and version.
2015-09-08 19:05:49 +02:00
Richard W.M. Jones
6c3bc24f90 Version 1.31.5. 1.31.5 2015-09-08 14:20:28 +01:00
Pino Toscano
6d08da07dc build: improve maintainer-check-extra-dist target
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).
2015-09-08 12:08:43 +02:00
Cédric Bosdonnat
fb9c17c8d4 Allow curl to follow redirects.
download.opensuse.org uses redirects to point to the relevant mirror.
Adding -L --max-redirs 5 to curl options will get us the requested
images.
2015-09-08 12:08:43 +02:00
Pino Toscano
268de62db6 builder: distribute simplestreams test files
Fixes commit b024aef6fb.
2015-09-08 11:51:49 +02:00
Pino Toscano
c8436df4a2 builder: replace colons in simplestreams test files
Colons won't be handled by make at all, so replace them with underscore
to be able to distribute them.
2015-09-08 11:51:49 +02:00
Richard W.M. Jones
c4bc8116d9 v2v: -o rhev, -o vdsm: Use correct DefaultDisplayType for qxl (RHBZ#1260590).
This fixes commit 829e3fe7a6.
2015-09-08 09:11:36 +01:00
Richard W.M. Jones
5ed4388ecd customize: Create .ssh as 0700 and .ssh/authorized_keys as 0600 (RHBZ#1260778).
Both ssh-copy-id and ssh create .ssh as 0700.  ssh-copy-id creates
.ssh/authorized_keys as 0600.

Thanks: Ryan Sawhill for finding the bug.
2015-09-08 09:09:40 +01:00
Pino Toscano
b024aef6fb builder: support Simple Streams v1.0 as index metadata
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.
2015-09-08 09:51:49 +02:00
Pino Toscano
13eac43e28 build: expose HAVE_YAJL to automake
This way it can be used in automake conditionals.
2015-09-08 09:51:49 +02:00
Pino Toscano
23d1719105 builder: add simple libyajl binding
Only yajl_val and yajl_tree_parse are exposed for now.
2015-09-08 09:51:49 +02:00
Pino Toscano
7dfbb1f11c builder: add non-int revisions
Add support for non-integer revisions of entries, comparing them as
integer when possible.
2015-09-08 09:51:48 +02:00
Richard W.M. Jones
8e28d6b188 v2v: windows: Warn if Group Policy or AV software may result in 7B boot failure (RHBZ#1260689).
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.
2015-09-07 17:47:21 +01:00
Richard W.M. Jones
8f889f0c3e v2v: windows: Refactor Xen uninstaller detection code.
No change, just refactoring.
2015-09-07 17:17:49 +01:00
Richard W.M. Jones
4335088d74 dib: Move 'isdigit' utility function to common code.
No change, just simple refactoring.
2015-09-07 16:53:17 +01:00
Richard W.M. Jones
4ded4430bf v2v: -o rhev, -o vdsm: Add sound card to OVF output.
For the two sound card types that RHEV can emulate, add
them to the output.
2015-09-07 15:00:50 +01:00
Richard W.M. Jones
829e3fe7a6 v2v: -o rhev, -o vdsm: Review XML based on oVirt description of format.
After reviewing http://www.ovirt.org/images/8/86/Ovirt_ovf_format.odt
this commit makes some small revisions to the OVF that we generate.

Possible fix for https://bugzilla.redhat.com/show_bug.cgi?id=1260590
2015-09-07 15:00:44 +01:00
Richard W.M. Jones
e271992746 v2v: Error if certain options appear twice on the command line.
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.
2015-09-07 12:18:21 +01:00
Richard W.M. Jones
0afe4773d0 Version 1.31.4. 1.31.4 2015-09-03 21:49:56 +01:00
Richard W.M. Jones
7e63d3680f v2v: test-harness: Allow test boot at fixed dates in the past.
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.
2015-09-03 20:11:07 +01:00
Richard W.M. Jones
6246bebf82 p2v: Clear previous version and driver information when testing connection (RHBZ#1227609).
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.
2015-09-03 16:12:22 +01:00
Richard W.M. Jones
302ea2aa5b p2v: Use gtk_list_store_clear instead of loop.
The model implements GtkListStore, so an easier way to clear the list
is simply to call the clear method.
2015-09-03 16:06:59 +01:00
Richard W.M. Jones
314713c3b0 p2v: Use GtkComboBoxText instead of deprecated gtk_combo_box_new_text.
Requires Gtk >= 2.24, which is the same version that RHEL 6 has.
2015-09-03 15:56:19 +01:00
Pino Toscano
cf3d93c826 get-kernel: respect -q
Now that virt-get-kernel has -q/--quiet, support it by printing the
download messages only if not specified.
2015-09-02 00:25:55 +02:00
Pino Toscano
45f6cfe1a1 get-kernel: refactor list and download code
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.
2015-09-02 00:25:55 +02:00
Pino Toscano
997c59139e get-kernel: split command line handling in own function
Simple refactoring, no actual behaviour changes.
2015-09-02 00:25:55 +02:00
Pino Toscano
b360e99ff6 builder, dib, get-kernel: document new -q/--quiet options
Provided as common options for all the OCaml-based tools.
2015-09-02 00:25:55 +02:00
Pino Toscano
2ec0332e5e mllib: move -q/--quiet as common option
Most of the OCaml-based tools had it already, except from virt-dib and
virt-get-kernel.
2015-09-02 00:25:55 +02:00
Pino Toscano
875f46fddc mllib: make few command line options stuff private
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.
2015-09-02 00:25:55 +02:00
Richard W.M. Jones
51bc573d0c v2v: Fix handling of extra slashes in dcPath calculation (RHBZ#1258342).
This updates commit 20f1eb400b.

Thanks: Tingting Zheng
2015-09-01 14:56:10 +01:00
Pino Toscano
4cc3cc3fbd mllib: set --debug-gc as common option
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.
2015-08-31 18:34:37 +02:00
Pino Toscano
2af6e48ba3 mllib: add and use set_standard_options
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.
2015-08-31 18:25:48 +02:00
Pino Toscano
7bdb3e0df9 customize: fix running commands on the same architecture
Wrap the command around an heredoc only if setarch needs to be used;
otherwise the heredoc will not be run at all.

Fix commit d875346ad4.
2015-08-31 17:55:14 +02:00
Richard W.M. Jones
2596b78bcb Version 1.31.3. 1.31.3 2015-08-28 19:34:15 +01:00
Richard W.M. Jones
95233a8eee p2v: Add test-virt-p2v-pxe.sshd_config.in to EXTRA_DIST.
Fixes commit afe3c77014.
2015-08-28 19:32:15 +01:00