Commit Graph

9401 Commits

Author SHA1 Message Date
Richard W.M. Jones
d03e8f461e builder: Fix URL for RHEL 7.2 ppc64le images. 2016-07-19 12:32:08 +01:00
Richard W.M. Jones
faf41e7fbb mllib: tests: Add tests to EXTRA_DIST.
Fixes commit 41a1b8a5ca.
2016-07-18 18:50:02 +01:00
Pino Toscano
34cdb1145e builder: improve the handling of list formats
Store them directly in List_entries, an adding helper function to
convert from string.

Also use Getopt.Symbol for them, so there is no need to manually reject
invalid formats.
2016-07-18 18:21:41 +02:00
Pino Toscano
99797a3d2f mllib: Getopt: add Getopt.Symbol
Introduce a new type of option to allow a value out of a fixed choice,
much like Arg.Symbol.
2016-07-18 18:20:57 +02:00
Richard W.M. Jones
41a1b8a5ca mllib: tests: Add tests of the new Getopt module. 2016-07-18 17:05:42 +01:00
Richard W.M. Jones
ba2cf9a2eb mllib: Use L"..." and S '...' for long and short options.
There is also an M"..." variant which acts the same way as
L but handles the annoying virt-v2v two letter options.
2016-07-18 17:01:22 +01:00
Richard W.M. Jones
4ac1744db4 mllib: getopt: Further fix int parsing.
Don't allow suffixes on integers, and fix the bounds to match the
definitions of Min_long and Max_long in <caml/mlvalues.h>.

Fixes commit 66b54bfefe.
2016-07-18 16:50:18 +01:00
Richard W.M. Jones
bef2d2f30e rescue: Implement virt-rescue -w option.
Documented, but never implemented.
2016-07-18 16:50:18 +01:00
Richard W.M. Jones
7352071dbf diff: Implement virt-diff --long-options.
The code was only partially implemented so the option did
not function.
2016-07-18 16:01:05 +01:00
Pino Toscano
b7e7fe396d mllib: Getopt: point to man page as additional help
On error, point also to the man page of the current tool in addition to
'$TOOL --help'.
2016-07-18 15:35:25 +02:00
Richard W.M. Jones
c2fda2c1f2 build: Factor out definition of BEST and OCAMLLINKFLAGS.
No change, just refactoring.
2016-07-18 14:11:22 +01:00
Richard W.M. Jones
2c6bfccb06 build: Fix dependencies on mllib and customize.
Binaries should be rebuilt if mllib.cma/mllib.cmxa or
customize.cma/customize.cmxa change.

Fixes commit 1e2877c6f4.
2016-07-18 14:10:28 +01:00
Richard W.M. Jones
fde0b73597 customize: Build virt-customize properly.
Fixes commit 6a0fe553b9.
2016-07-18 13:54:23 +01:00
Pino Toscano
66b54bfefe mllib: Getopt: fix integer parsing
Since we are using gnulib already, make use of xstrtol to parse the
integer arguments to avoid extra suffixes, etc.

Fixes commit 0f7bf8f714.
2016-07-18 10:58:14 +02:00
Richard W.M. Jones
4920ff57c9 Version 1.33.43. v1.33.43 2016-07-14 15:44:03 +01:00
Richard W.M. Jones
3bf9420f94 builder: Add new centos-aarch64.sh script to EXTRA_DIST.
Fixes commit c168638ae7.
2016-07-14 15:40:42 +01:00
Richard W.M. Jones
6a0fe553b9 customize: Build a customize.cma/customize.cmxa library.
Instead of linking with individual objects, which is very tedious,
build a proper library and link virt-builder, virt-customize and
virt-sysprep to it.

This makes the binaries a tiny bit smaller because .cmxa/.a files
allow unused code to be removed by the linker, whereas explicitly
linking .cmx/.o files does not.
2016-07-14 15:40:42 +01:00
Richard W.M. Jones
1e2877c6f4 mllib: Build a mllib.cma/mllib.cmxa library.
Instead of linking with individual objects, which is very tedious,
build a proper library and link the other tools with it.

This doesn't make the resulting binaries any larger.
2016-07-14 15:28:10 +01:00
Richard W.M. Jones
fc11490484 v2v: linux: Use new SELinux_relabel module to relabel Linux guests. 2016-07-14 15:28:10 +01:00
Richard W.M. Jones
35bac3a650 lib: Deprecate old SELinux APIs, rewrite SELinux documentation (RHBZ#1152825).
Also turns the --selinux option of guestfish, guestmount and
virt-rescue into a no-op -- it didn't work before so this is
effectively no change.
2016-07-14 15:28:10 +01:00
Richard W.M. Jones
b6e92b1100 builder: Use virt-sysprep --selinux-relabel when preparing templates.
Don't need to be clever now.
2016-07-14 15:28:10 +01:00
Richard W.M. Jones
f3c69fe60b customize: Add module for doing SELinux relabel of filesystem (RHBZ#554829, RHBZ#983969, RHBZ#1089100).
This implements the --selinux-relabel option for virt-customize,
virt-builder and virt-sysprep.  There is no need to autorelabel
functionality now.

Thanks: Stephen Smalley
2016-07-14 15:28:10 +01:00
Richard W.M. Jones
6ec75f8cfe tests: Add a test of the setfiles API. 2016-07-14 15:28:10 +01:00
Richard W.M. Jones
9d205f1c28 New API: selinux_relabel - SELinux relabel parts of the filesystem. 2016-07-14 15:28:10 +01:00
Pino Toscano
fd60be9509 appliance: touch /etc/fstab when enabling the network (RHBZ#1224795)
Sadly, the dhclient-script shipped as part of isc-dhcp-client in Ubuntu
unconditionally reads from /etc/fstab without checking for its
existence.  Since no package holds /etc/fstab, this file will not exist
in the appliance, cause dhclient to fail (actually keep looping calling
the failing dhclient-script) when the network is requested.

As a workaround, touch /etc/fstab just before enabling the network: if
that file exists nothing changes, while an empty file will be available
in the other case, making at least dhclient-script in Ubuntu working.
2016-07-14 14:09:18 +02:00
Richard W.M. Jones
eb22e2d36e v2v: Move augeas_debug_errors (renamed debug_augeas_errors) to common code.
Since the function uses the StringMap module, I also had to
move this to mllib.

The function is renamed and the 'if verbose ()' part is moved into the
function, but apart from that, it's all just code motion.
2016-07-14 11:40:22 +01:00
Pino Toscano
412dedd029 po: fix markups in Ukrainian translation
- remove extra \n at end of msgstr (not present in its msgstr)
- fix printf format specifier
2016-07-14 11:02:36 +02:00
Pino Toscano
7a404b1110 mllib: Getopt: support hidden options
Add a dummy description value to mark an option as "hidden", so it will
not be shown in the help text.

Mark few options as hidden:
- common: --short-options, --long-options, --debug-gc
- virt-sysprep: --dump-pod, --dump-pod-options

Since --debug-gc is now really considered internal, it is no more
documented.
2016-07-14 10:58:56 +02:00
Pino Toscano
0f7bf8f714 OCaml tools: add and use a Getopt module
Add a new Getopt module to mllib, to parse command line arguments with
handlers close to the ones used with Arg, but using getopt(3) (actually
getopt_long_only) to do the real parsing.  This allow us to provide
options for OCaml tools with a syntax similar to the C tools, and use
the additional features getopt offers and Arg does not.
Getopt now handles every part of the command line handling, including
the output of short & long options.

Do a single-step conversion of Common_utils and all the OCaml tools to
the syntax of Getopt.

Move a couple of utility functions from Common_utils to Getopt, since
they fit better there (and Common_utils cannot be used in Getopt, as
the former already uses the latter).

As side-change due to the conversion, extra arguments for sysprep
operation can have more keys for the same argument.
2016-07-13 18:43:32 +02:00
Pino Toscano
cbf4bbf266 i18n: fix markups in Japanese translation
Avoid extra spaces in L<>, they cause the POD to be invalid.
2016-07-13 18:15:26 +02:00
Richard W.M. Jones
c168638ae7 builder: Add CentOS aarch64 image. 2016-07-13 12:59:52 +01:00
Richard W.M. Jones
6dc3a59e73 Upload and download files to Zanata. 2016-07-12 21:43:31 +01:00
Richard W.M. Jones
a468e8b92f p2v: Set LD_LIBRARY_PATH for "remote" virt-v2v process.
In previous commit c5f12e47e4 we changed
the PATH environment variable to run the locally built virt-v2v, not
the system-installed virt-v2v.

However this meant that we were running the locally built virt-v2v
against the system-installed libguestfs.so.0.  We also need to set
LD_LIBRARY_PATH.

Fixes commit c5f12e47e4.
2016-07-12 14:48:11 +01:00
Tomáš Golembiovský
e93d4ea320 v2v: Add support for Win2016 virtio drivers
Support virtio drivers for Windows Server 2016 once they are available.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-07-12 08:25:29 +01:00
Richard W.M. Jones
2c7f8e9c5f utils: Clarify why some uses of gnulib are OK and others not OK. 2016-07-11 19:11:01 +01:00
Richard W.M. Jones
56eb5f36f4 Revert "utils: Allow use of gnulib in this file."
This reverts commit 975eafe4ba.
2016-07-11 19:08:41 +01:00
Richard W.M. Jones
d272cee838 python: Don't generate calls with non-existent C optargs structures.
In the case where we are building a Python dist (which can be
distributed separately), we generated calls to non-existent optargs
structures if an API was once no-optargs but had optargs added.  A
typical error was this (library: 1.32.5, Python sdist: 1.33.42):

    guestfs-py.c: In function ‘guestfs_int_py_glob_expand’:
    guestfs-py.c:9648:40: error: storage size of ‘optargs_s’ isn’t known
       struct guestfs_glob_expand_opts_argv optargs_s;

This is a simple solution to this, although it has the possible
disadvantage that such functions will not be bound at all.
2016-07-11 18:33:05 +01:00
Richard W.M. Jones
1f650932e3 python: Add documentation to guestfs-python about using pip & virtualenvs. 2016-07-11 15:47:51 +01:00
Richard W.M. Jones
c56c6e9010 python: Fix python sdist.
Since commit 83e92b4a97, utils.c
includes "ignore-value.h".  We copy utils.c into the python sdist
tarball, but it didn't not compile because of the missing header file.
Therefore we need to copy the header in too.

Fixes commit 83e92b4a97.
2016-07-11 15:46:23 +01:00
Richard W.M. Jones
4140766460 v2v: Document ports, firewall and proxy settings used by vCenter. 2016-07-11 13:39:23 +01:00
Richard W.M. Jones
711c4c923d Version 1.33.42. v1.33.42 2016-07-09 09:36:58 +01:00
Maxim Perevedentsev
4e0dbf94e7 sysprep: fix btrfs subvolume processing in fs-uuids
guestfs_set_uuid wants device as argument.
Moreover, btrfstune -U is unable to set uuid for subvolumes,
only unmounted partitions are supported.

Here we skip btrfs subvolumes.
2016-07-08 13:21:42 +01:00
Maxim Perevedentsev
f90185dfdf lvm: modify guestfs_is_lv to take mountable
Calling guestfs_is_lv on btrfs subvolume throws an error.
Here we workaround it by taking Mountable instead of Device
and returning 'false' for non-device mountables.
2016-07-08 13:21:42 +01:00
Maxim Perevedentsev
d6bba9bc42 mllib: add checking for btrfs subvolume
This is needed to skip btrfs subvolumes from output
of list_filesystems where device is needed.
2016-07-08 13:21:42 +01:00
Matteo Cafasso
abf85b050e filesystem_walk: more information into tsk_dirent
Access, modification, last status change and creation time in
Unix format as for statns.

Number of links pointing to a given entry.

If the entry is a symbolic link, report the its target path.

A new flag (DIRENT_COMPRESSED 0x04) indicating whether the file is
compressed using native filesystem compression support.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-07-08 12:08:17 +02:00
Richard W.M. Jones
123dc018b8 mllib: Rename unshift -> push_front, push -> push_back etc.
The C++ function names are more regular.

Updates commit 1c57c71d46.
2016-07-08 09:56:47 +01:00
Richard W.M. Jones
1a3e986b61 builder: Add Fedora 24 (aarch64) image. 2016-07-07 20:36:42 +01:00
Richard W.M. Jones
7d99c2eb84 builder: downloader: More tweaks to curl code.
No functional change.
2016-07-07 18:22:09 +01:00
Richard W.M. Jones
560156d899 v2v: Use imperative list functions to simplify DOM building code. 2016-07-07 18:13:07 +01:00
Richard W.M. Jones
6a3416361b v2v: Don't open DOM module in output_rhev and output_vdsm.
I think this is left over from before we moved the OVF code
out to its own module.
2016-07-07 18:13:07 +01:00