Commit Graph

8258 Commits

Author SHA1 Message Date
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
Richard W.M. Jones
d875346ad4 customize: Use setarch when running commands on i686 guest (RHBZ#1256405).
When running (eg) dnf on a 32 bit i686 guest when the host is 64 bit
x86_64, dnf believes it is running on a 64 bit machine and so tries to
install x86_64 packages.  We can 'trick' dnf into believing it's a 32
bit machine using the setarch program.

$ virt-builder fedora-22 --arch i686 --install 'gperf'
...
[  27.4] Installing packages: gperf
...
Running transaction test
Error: Transaction check error:
  package libgcc-5.1.1-4.fc22.x86_64 is intended for a different architecture
...

The use of a heredoc to solve quoting issues comes from:
http://stackoverflow.com/a/3435460

Thanks: Jan Sedlák for finding the solution.
2015-08-28 19:09:17 +01:00
Richard W.M. Jones
18b019e3dd v2v: -i libvirtxml: Map empty network or bridge name to default (RHBZ#1257895).
As with the -i ova driver, if an unnamed network is found, map it to
"eth0", "eth1" etc.
2015-08-28 19:09:17 +01:00
Richard W.M. Jones
261d05749f v2v: Convert xpath_to_* to use xpath convenience functions.
In -i libvirtxml, -i ova and -o libvirt drivers, replace the ad hoc
xpath_to_* functions with use of the new xpath convenience functions
introduced in the previous commit.

This is not entirely refactoring because I fixed a few bugs found by
type safety.
2015-08-28 19:09:17 +01:00
Richard W.M. Jones
00e1260d34 v2v: Add convenience functions for parsing xpath expressions. 2015-08-28 19:09:17 +01:00
Richard W.M. Jones
20f1eb400b v2v: vcenter: Calculate dcPath correctly (RHBZ#1256823).
Previously given a path such as:

  vpx://vcenter/Folder/Datacenter/esxi

we calculated dcPath=Folder.  However this is obviously wrong.  We
should chop the path at the final (esxi) element to give
dcPath=Folder/Datacenter.
2015-08-28 17:53:41 +01:00
Richard W.M. Jones
1585bb5bee v2v: vcenter: Change function get_datacenter -> get_dcPath.
In vCenter, the datacenter is identified by a path, and the parameter
used for this is called 'dcPath'.  Rename the function to avoid any
confusion about what we're getting here.

This is just renaming function/variable names and has no other effect.
2015-08-28 17:53:41 +01:00
Roman Kagan
a628fb65fa handle --debug-gc universally via at_exit hook
Several tools handle --debug-gc command-line option, by explicitly
forcing GC on every exit path.  This is tedious and prone to forgetting
some of the exit paths.

Instead, add a generic handler for --debug-gc, which installs an at_exit
hook to do the GC consistency check, and which can be called right in
the command-line parser.  Also adjust all users of --debug-gc to use
that handler.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
2015-08-28 17:53:41 +01:00
Richard W.M. Jones
afe3c77014 p2v: Add a test for the PXE boot path (RHBZ#1256222).
Build the P2V disk image and boot it.  We don't actually use PXE
specifically, but we do test the whole PXE / kernel command line path
much more thoroughly.

This is a 'check-slow' test because it takes ages to run.
2015-08-27 15:42:55 +01:00
Richard W.M. Jones
ca4725e1c7 p2v: Add SSH Identity URL.
Allow SSH identities (ie. secret keys) to be used for authentication
instead of passwords.
2015-08-27 15:42:55 +01:00
Richard W.M. Jones
3c30fb4a79 Revert "p2v: Add tip about the root password of the virt-v2v conversion server appliance."
This reverts commit 35efaf8208.
2015-08-27 15:42:55 +01:00
Richard W.M. Jones
4c34d240a1 p2v: Wait for network to come online before testing connection (RHBZ#1256222).
When using the virt-p2v ISO in command line mode, we did not wait for
the network to come online before starting virt-p2v.  Therefore
virt-p2v could exit with an error when testing the ssh connection (or
on the other hand, it might work randomly).  If the user logs in and
runs 'launch-virt-p2v' by hand, then it would usually work because the
network had been brought online in the meantime.

Fix this by waiting for NetworkManager to bring the connection online
before calling test_connection().  Note that the obvious way to fix
this (changing the systemd service to wait for network-online.target)
does *not* work - I added a comment to the service about this.

Thanks: Tingting Zheng
2015-08-27 15:42:55 +01:00
Pino Toscano
c1e1e23285 osinfo: add altlinux and mageia distributions 2015-08-25 17:39:26 +02:00
Pino Toscano
70579d08cd inspect: recognize the ALT Linux distribution
Check its presence ahead of /etc/redhat-release, as the distro provides
it and thus previously it was recognized as "redhat-based".
2015-08-25 16:17:59 +02:00
Pino Toscano
74f0b45ddf v2v: ignore missing kernels from grub (RHBZ#1230412)
Raise a warning for each kernel specified in grub which does not
actually exist, keep going on with the conversion using the remaining
(existing) kernels.
2015-08-24 18:25:10 +02:00
Pino Toscano
baa4ec6e45 ocaml: Add handling for errno ENOENT. 2015-08-24 18:11:18 +02:00
Pino Toscano
649f439cb7 ocaml: dynamically generate the content of Guestfs.Errno
Put in a list the errnos to expose, filling the content of the
Guestfs.Errno submodule from that.
Also, generate a separate guestfs-c-errnos.c with the implementations of
the functions returning the errno codes.

Only code motion and refactoring, no actual changes on the content of
the ocaml Guestfs module.
2015-08-24 17:57:10 +02:00
Pino Toscano
0dcb862943 configure: look for "java" as directory for Java in lib64 too
On 64-bit openSUSE versions, /usr/lib64/jvm/java provides the symlink to
the default Java version.
2015-08-20 17:25:34 +02:00
Pino Toscano
e6dd9b5d6b appliance: explicitly add libyajl on Mageia
It seems yajl was bringing it, but seems not on Mageia 5.  Leave yajl
for older versions.
2015-08-19 14:46:39 +02:00
Richard W.M. Jones
97bd64f588 FAQ: the -> and in previous commit.
This fixes commit 571fca8e71.
2015-08-13 22:54:30 +01:00
Richard W.M. Jones
571fca8e71 FAQ: Further improve debugging section. 2015-08-13 22:51:43 +01:00
Richard W.M. Jones
8828005691 Version 1.31.2. 1.31.2 2015-08-13 16:46:08 +01:00
Richard W.M. Jones
08b57ae1f4 builder/website: Fix EXTRA_DIST.
This fixes commit 190a9f4534 and
commit 864ca489ac.
2015-08-13 16:45:30 +01:00
Richard W.M. Jones
c9ad61b37b p2v: Modify some partial match regexps to work with pcre 7.8.
pcre < 8 has limitations on the types of partial matching
possible.  As noted in the pcrepartial(3) man page, these can
be worked around by adding non-capturing parentheses around
various subexpressions, as I have done here.
2015-08-13 15:48:36 +01:00
Richard W.M. Jones
92e155dbdd p2v: For pcre < 8 (RHEL 6), abort if partial matching cannot be used on a regexp. 2015-08-13 15:48:36 +01:00
Richard W.M. Jones
1d082d127e p2v: Print an error if gtk_init_check fails.
Apparently gtk_init_check doesn't (always?) print an error message
when it returns false, so virt-p2v just exits without any message.

This was observed on RHEL 6 when $DISPLAY was not set.
2015-08-13 14:13:49 +01:00
Richard W.M. Jones
2bfb9ff9ea p2v: Call g_thread_init with old glib2 as used by RHEL 6. 2015-08-13 13:51:11 +01:00
Richard W.M. Jones
00bceec421 v2v: Help RHEL 6 OCaml to determine type of class.
File input_libvirt_other.ml, line 1, characters 0-1:
Error: The implementation input_libvirt_other.ml
       does not match the interface input_libvirt_other.cmi:
       Class declarations do not match:
         class virtual input_libvirt :
           'a ->
           string option ->
           string ->
           object
             method adjust_overlay_parameters : Types.overlay -> unit
             method as_options : string
             method virtual source : unit -> Types.source
           end
       does not match
         class virtual input_libvirt :
           string option ->
           string option ->
           string ->
           object
             method adjust_overlay_parameters : Types.overlay -> unit
             method as_options : string
             method virtual source : unit -> Types.source
           end
       A parameter has type 'a but is expected to have type string option
2015-08-13 13:23:59 +01:00
Richard W.M. Jones
b0cd6917ca v2v: Hide StringMap functions we're not actually using.
In RHEL 6 OCaml, some of these functions were not part of the Map
class, giving an error.  Hide the ones we aren't using.
2015-08-13 13:23:59 +01:00
Richard W.M. Jones
437cb7b6ff handle: Move #pragma out of functions.
RHEL 6 gcc did not support #pragma within functions.
2015-08-13 13:23:59 +01:00
Richard W.M. Jones
06e92bffd4 p2v: Add replacement for xmlBufferDetach function not available in RHEL 6. 2015-08-13 13:23:59 +01:00
Richard W.M. Jones
42b6bb12dc v2v: -oa preallocated for qcow2 output now fully allocates the file (RHBZ#1251909).
When the output format is qcow2 and -oa preallocated is used,
previously it would only allocate the metadata.  That was a regression
over previous behaviour of virt-v2v 0.9.  Change it so it allocates
the full file size in this case.
2015-08-13 13:23:59 +01:00
Richard W.M. Jones
66daad38f3 disk-create: Allow preallocation off/metadata/full.
For raw, this allows "off" as a synonym for "sparse" (to make it
consistent with qcow2).

For qcow2, this allows "sparse" as a synonym for "off".

It also adds qcow2 "full" preallocation, which is actually mapped to
the qemu option "falloc" (see arguments about this on the qemu-devel
mailing list, which we lost).

This also updates the test.
2015-08-13 13:23:58 +01:00
Pino Toscano
d78f685c0e builder: normalize architectures
Normalize the target architecture, and also each architecture when
checking for a compatible image.

This sort of reverts the effects of
commit 8864c47b94, but at least it is
possible to build e.g. Debian-based amd64 images on any x86_64 system
without being considered as foreign architecture.
2015-08-12 18:22:34 +02:00
Pino Toscano
0bbb903f42 mllib: add normalize_arch helper
Small helper to normalize an architecture string, so it is easier to
compare them and check for compatibilities.

Make use of it in guest_arch_compatible, simplifying it.
2015-08-12 18:22:34 +02:00
Pino Toscano
90b459a5db dib: expand doc on external dependencies for appliance 2015-08-12 18:21:08 +02:00
John Eckersberg
c2bb87e8f2 dib: handle unsetting functions in environment
If a function name, with its trailing parentheses, is in the
environment , trying to unset it will error out with a message of "not
a valid identifier".  Handle this as a special case, and unset it with
the -f option which can handle the parentheses in the supplied
identifier.
2015-08-12 17:20:38 +02:00
Pino Toscano
70d020f074 inspect: support the APK package manager and its format
Associate the Alpine Linux distribution with it.
2015-08-12 16:23:45 +02:00