Commit Graph

10676 Commits

Author SHA1 Message Date
Tomáš Golembiovský
285014b290 v2v: vdsm: add --vdsm-fixed-ovf option
Add option for -o vdsm that enables output of the modified OVF. oVirt
engine should already be able to consume the OVF, but let's not take any
chances and enable it only by command line argument. It can be made
default later when it receives proper testing.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2018-02-22 15:06:13 +00:00
Tomáš Golembiovský
a52ed4b445 v2v: ovf: Create OVF more aligned with the standard
For historical reasons the OVF used in RHV export domain contains some
deviations from the OVF standard. The format used in -o rhv has to
remain fixed but for -o vdsm and we could produce much nicer OVF. This
patch serves as a preparatory step to this.

The main reason for creating different OVF is that it can be used to
create VM by oVirt REST API. The RHV export domain flavor cannot be used
that way.

For now the virt-v2v behavior is unchanged. The modified output will be
enabled in some later patch.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2018-02-22 15:06:13 +00:00
Tomáš Golembiovský
8fb60072cc v2v: tests: check generated OVF
Check the generated OVF for -o rhv and -o vdsm outputs. Variable UUIDs
and date/times are filtered out. Make sure the the important UUIDs
(disk, volume, VM) are where we think they should be.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2018-02-22 15:06:13 +00:00
Pino Toscano
1c996bf314 daemon: tsk: handle new enum values in sleuthkit 4.5
Resort to a version check for them, as they do not exist in older
versions.
2018-02-19 17:14:18 +01:00
Pino Toscano
491970b82f lib: qemu: help GCC 8 by break'ing a case in a switch
GCC 8 thinks that the case drive_protocol_gluster may fall through, most
probably because the only code is a switch case that handles the
elements of an enum, and thus letting other fall through. In reality
this ought to not happen at all, so help GCC by break'ing the case,
which will then lead to the abort() at the end of
guestfs_int_drive_source_qemu_param.
2018-02-19 17:14:18 +01:00
Pino Toscano
83d2fa510f appliance: add lib64jansson4 on Mageia
Apparently the jansson library on 64bit installation does not provide
the non-64bit name, so jansson is not pulled in the appliance, and thus
the daemon does not start.

Updates commit eb4fbe96c9.
2018-02-19 17:14:18 +01:00
Pino Toscano
0cca7f9061 appliance: include dash for Debian distros
Make sure that /bin/sh is available in the appliance, and that path is
provided by dash on Debian distributions.
2018-02-19 15:47:08 +01:00
Pino Toscano
535a4471f3 inspect: use check_tests also for detecting Hurd
Even though the list of checks is very short, at least this migrates
from imperative checks to a "declarative" one.

There should be no behaviour change, other than using os-release if it
contains all the needed information.
2018-02-14 17:19:52 +01:00
Pino Toscano
eb4fbe96c9 build: mandate Jansson >= 2.7
Since we use APIs added in Jansson 2.7 (e.g. json_string_length), then
raise the minimum version required to that version.

Fixes commit bd1c5c9f4d.
2018-02-13 13:07:22 +01:00
Pino Toscano
62b09ba0b0 inspector: fix help text (RHBZ#1544674) 2018-02-13 10:54:05 +01:00
Pino Toscano
5c5f69ef37 customize, sysprep, v2v: handle Kali Linux as Debian
Kali Linux is a Debian derivative, so add basic support for it by using
most of the Debian code paths.  The only exception is the crypto
algorithm for passwords in passwd, which is always assumed as SHA512
(as Kali Linux is relatively new).
2018-02-12 14:32:19 +01:00
Pino Toscano
1dd11d2276 inspect: recognize the Kali Linux distribution (RHBZ#1544227)
Read the information from os-release, and make it behave like a
Debian distribution (i.e. using dpkg, and apt).
2018-02-12 14:32:19 +01:00
Pino Toscano
bd1c5c9f4d Switch from YAJL to Jansson
While YAJL mostly works fine, it did not see any active development in
the last 3 years.  OTOH, Jansson is another JSON C implementation, with
a very liberal license, and a much nicer API.

Hence, switch all of libguestfs from YAJL to Jansson:
- configure checks, and buildsystem in general
- packages pulled in the appliance
- actual implementations
- contrib scripts
- documentation

This also makes use of the better APIs available (e.g. json_object_get,
json_array_foreach, and json_object_foreach).  This does not change the
API of our OCaml Yajl module.
2018-02-12 11:24:06 +01:00
Richard W.M. Jones
d0e5a819e8 python: Fix missing & additional backslashes which broke python sdist.
Fixes commit e6c89f9631.
2018-02-09 16:00:00 +00:00
Richard W.M. Jones
1e99b96179 Version 1.38.0. v1.38.0 2018-02-09 09:39:02 +00:00
Richard W.M. Jones
ed1c8fcfd7 docs: Finalize release notes for 1.38. 2018-02-09 09:39:00 +00:00
Richard W.M. Jones
dc44de5e23 authors: Add a list of aliases.
This handles the case where a single author has multiple different
names in the git commit history.
2018-02-09 09:39:00 +00:00
Richard W.M. Jones
c00998b90e ocaml: When creating compat Bytes module, create bytes.mli file.
On distros with OCaml < 4.02 we need to create a compatibility Bytes
module.  However we didn't create the interface file (bytes.mli) which
would mean that dependencies wouldn't be created correctly for
parallel builds.  This commit uses ‘ocaml -i’ to create an interface
file which exports everything.
2018-02-08 17:16:41 +00:00
Yuri Chornoivan
7e4f03d2c2 Fix minor typos 2018-02-08 13:20:34 +01:00
Pino Toscano
6acf236d24 python: add missing newline
When checking the return value of guestfs_int_py_fromstring for string
fields of structs, add a newline to generated C code, so it is properly
indented.

Fixes commit 401c445636.
2018-02-08 13:11:51 +01:00
Richard W.M. Jones
d56a3aa0f0 diff: Fix typo in manual page.
Reported by: Yuri Chornoivan
2018-02-07 18:38:13 +00:00
Daniel P. Berrangé
3c7bbf97e2 daemon: add inspector support for MS-DOS distro
An installation of MS-DOS has various files in a /DOS directory,
which COMMAND.COM looking like a reasonable signal that its MS-DOS
or a very close relative there-of.

This is validated with an MS-DOS 6.22 install.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-07 18:18:27 +00:00
Richard W.M. Jones
6893c40627 tmpdirs: Make the ‘su broken’ error message actionable.
Revert "tmpdirs: Blame systemd because su is broken."

This reverts commit 9464304d7a.

Replace with an actionable error message.
2018-02-07 17:26:58 +00:00
Pino Toscano
693a8175ee fish: add a small doc note about -- for args (RHBZ#1536603)
This will hint what to do when any argument of a command starts with a
dash.
2018-02-07 17:33:14 +01:00
Pino Toscano
3d4c84185a v2v: fix -it ssh syntax in example (RHBZ#1540535)
Updates commit 1d38216d20.
2018-02-07 17:26:37 +01:00
Pino Toscano
8ce1373847 customize: avoid Array.mem for now
Since it is available only in OCaml >= 4.03, which is higher than our
requirement, add a simple reimplementation of it.

Fixes commit 719d68fa24.
2018-02-07 16:54:09 +01:00
Richard W.M. Jones
b10aa60d54 docs: Remove or correct links to virt-tools.org.
Unfortunately I wasn't able to find a good reference for checking if
your hardware virt is enabled.

Thanks: Yuri Chornoivan
2018-02-07 14:49:25 +00:00
Richard W.M. Jones
9464304d7a tmpdirs: Blame systemd because su is broken. 2018-02-07 14:36:15 +00:00
Richard W.M. Jones
4a771d30d9 website: Update links to new development branch and stable branches. 2018-02-07 14:35:59 +00:00
Richard W.M. Jones
6bb9884018 maintainer: Update translations from Zanata.
There were some problems with the Ukrainian translations which I have
fixed.  The 3 magic strings __CUSTOMIZE_OPERATIONS__,
__CUSTOMIZE_SYNOPSIS__ and __OPERATIONS__ were translated, breaking
substitutions in virt-builder, virt-customize and virt-sysprep manual
pages.
2018-02-07 14:28:25 +00:00
Richard W.M. Jones
248d91bfa4 maintainer: Update to latest gnulib. 2018-02-07 13:26:23 +00:00
Richard W.M. Jones
900cdc9d8e docs: release notes: Hivex 1.3.14 is _not_ required. 2018-02-07 13:26:23 +00:00
Pino Toscano
82fbf294fd daemon: build also without Hivex.OPEN_UNSAFE (RHBZ#1493048)
Do a configure check for the OPEN_UNSAFE flag in the OCaml binding of
Hivex, using it only when available.  This makes it possible to use
hivex < 1.3.14 to build libguestfs (the daemon, actually).

Amend the building documentation accordingly, bringing the minimum
version of hivex back as it was before
commit 64f49df747.
2018-02-06 17:27:23 +01:00
Richard W.M. Jones
382b544731 Version 1.37.37. v1.37.37 2018-02-06 14:24:18 +00:00
Richard W.M. Jones
ee36f582d4 docs: Update release notes for 1.38 release. 2018-02-06 13:27:45 +00:00
Pino Toscano
719d68fa24 customize: allow missing SELINUXTYPE in SELinux config
libselinux defaults to "targeted" when no SELINUXTYPE is specified in
/etc/config/selinux.  Hence do the same here, instead of failing because
of the missing key.

Add a slow test for checking SELinux relabeling on a Fedora 27 guest,
both with no changes, and with a modified configuration.
2018-01-31 17:50:50 +01:00
Richard W.M. Jones
0c3d2d9430 customize: Correctly handle crypt(3) returning NULL (RHBZ#1539395).
In particular glibc's crypt will return NULL / errno == ENOSYS and
other implementations might do that in future too.

Reported by: David Hill
2018-01-30 14:18:35 +00:00
Richard W.M. Jones
7021a234aa p2v: tests: Fix slow test ‘test-virt-p2v-pxe.sh’.
Since virt-builder Fedora 27 templates now use GPT, the root
filesystem has moved from /dev/sda3 to /dev/sda4.  /dev/sda3 is now a
swap device which could not be mounted as the root device, although
systemd unhelpfully hides the error unless you run qemu interactively.

I think this fixes commit a06e50e263.
2018-01-26 10:52:56 +00:00
Richard W.M. Jones
ff80f294d3 Version 1.37.36. v1.37.36 2018-01-25 14:30:43 +00:00
Richard W.M. Jones
b0df5f26fe customize: Use libxcrypt if available to provide crypt(3).
glibc 2.27 removes crypt(3) and suggests using libxcrypt.
libxcrypt requires <crypt.h> to be included.
2018-01-23 20:57:16 +00:00
Richard W.M. Jones
e4c3968880 lib/info: Remove /dev/fd hacking and pass a true filename to qemu-img info.
It obscures what's really going on and is no longer necessary
for the original purpose.

This reverts commit d50cb7bbb4.

See also:

  https://www.redhat.com/archives/libguestfs/2017-November/thread.html#00226
  https://www.redhat.com/archives/libguestfs/2017-December/thread.html#00044
2018-01-23 20:57:16 +00:00
Mykola Ivanets
24d1d46c98 lib: docs: guestfs_list_filesystems no longer needs to be used soon after launch when nothing is mounted.
guestfs_list_filesystems uses mount/umount to discover btrfs
sub-volumes and since 1.37 it generates random mountpoint so it will
longer affect already mounted filesystems if either.
2018-01-23 10:22:55 +00:00
Richard W.M. Jones
c3dd3f51a6 lua, perl: Use thread-safe strerror_r instead of strerror (RHBZ#1536763). 2018-01-22 17:52:46 +00:00
Richard W.M. Jones
e04aa823d1 perl: Free array on error path to avoid leak (RHBZ#1536765). 2018-01-22 17:52:46 +00:00
Richard W.M. Jones
a30b51747f launch: direct: Use old-style file= and format= parameters when not disabling locking (RHBZ#1503497).
Ancient qemu 1.5 (in RHEL 7) does not understand the
file.file.filename= and file.driver= parameters.  Go back to using the
old-style file= and format= parameters when we're not trying to set
the file.backing.file.locking=off parameter.

Fixes commit 9fe592808c.

Thanks: Yongkui Guo, Václav Kadlčík.
2018-01-19 16:01:01 +00:00
Richard W.M. Jones
7e43ef4171 common/mlxml: Remove -cclib from ocamlmklib.
ocamlmklib will get confused if the -cclib parameter expands to
anything except a single -lxml2 argument.  In any case it's not
necessary to specify the linker command here since every use of this
library links in a program to libxml2.
2018-01-16 13:03:39 +00:00
Richard W.M. Jones
49263be47a configure: Don't define _FORTIFY_SOURCE.
We routinely test the upstream code by running everything under
valgrind, and in any case _FORTIFY_SOURCE is usually defined by
downstream Linux distros and we can leave the optimization vs safety
decision to them.

See this bug: https://bugs.gentoo.org/640494
2018-01-16 13:03:39 +00:00
Cédric Bosdonnat
7c986228d5 resize: copy GPT partition flags
In some cases, the first stage bootloader needs the 'Legacy BIOS
bootable' flag to be set on the partition. This change copies all
flags (including this one) for each partition of the old disk to the
new one to avoid ending up with non-bootable disks.
2018-01-16 13:03:39 +00:00
Cédric Bosdonnat
c5fdc4f764 New APIs: part_set_gpt_attributes and part_get_gpt_attributes
Allow reading and setting the GPT partition attribute flags.
2018-01-16 13:03:39 +00:00
Cédric Bosdonnat
5f26f70262 daemon: make sgdisk_info_extract_uuid_field more generic
Rename the sgdisk_info_extract_uuid_field to
sgdisk_info_extract_field in order to reuse it for other field types.
Just like its C ancestor, it now needs an extractor function to be
passed as parameter.
2018-01-16 12:51:46 +00:00