Commit Graph

9497 Commits

Author SHA1 Message Date
Richard W.M. Jones
913dd8a087 v2v: Use OVMF secure boot file (RHBZ#1367615).
From RHEL 7.3, Red Hat have decided to only compile the secure boot
version of OVMF on x86-64, with flags -D SECURE_BOOT_ENABLE -D SMM_REQUIRE.

The filename has also changed to reflect this - it is now
/usr/share/OVMF/OVMF_CODE.secboot.fd.  The old file
/usr/share/OVMF/OVMF_CODE.fd is no longer shipped.

However switching to using this variant of OVMF for UEFI guests is not
just a matter of changing the filename.  The new OVMF variant won't
run unless we also change:

 - The qemu machine model, from the default ("pc" ==
   "pc-i440fx-rhel7.3.0" or later) to Q35 ("q35" == "pc-q35-rhel7.3.0"
   or later).

 - Add <smm> under <features>.

 - Set <loader ... secure="yes">.

NB: On RHEL the changes requires qemu-kvm-rhev.  It is no longer
possible to convert UEFI guests using the basic qemu-kvm.

Thanks: Laszlo Ersek, Ming Xie.
2016-08-18 14:48:51 +01:00
Richard W.M. Jones
0c396650b0 Generate the lists of UEFI firmware paths.
Previously we had a list of UEFI paths in src/uefi.c, which was
accessed in virt-v2v using a private (guestfs_int_*) API and some C
binding code.  This was clumsy and required the paths to be replicated
in the virt-v2v unit tests.

Instead just generate the list of paths from the generator, creating
src/uefi.c and v2v/uefi.ml with the same content.

Remove the C bindings and the virt-v2v unit tests associated with UEFI
paths.
2016-08-18 14:48:51 +01:00
Pino Toscano
17a9712126 v2v: linux: simplify RPM database cleaning
Iterate on the array directly, instead of converting it to a list to do
the same; also, avoid a temporary variable for it.
2016-08-18 14:00:43 +02:00
Pino Toscano
5991ce1c2a build: add silent rules for jar 2016-08-18 13:00:27 +02:00
Richard W.M. Jones
c5a06ae1ad v2v: test-harness: Print the full path of the virt-v2v binary under test. 2016-08-17 17:13:41 +01:00
Richard W.M. Jones
5c03a2ca8b v2v: OVMF is now fully open source, fix the man page. 2016-08-17 14:36:51 +01:00
Richard W.M. Jones
326200c433 Version 1.35.1. v1.35.1 2016-08-16 15:06:17 +01:00
Richard W.M. Jones
dd22e376c4 v2v: Add -o discard option when fstrimming.
This *may* be required by some filesystems in order for fstrim to
work.  I'm not actually sure if this is true, but it's what
virt-sparsify --in-place does, and that utility has been tested a lot
more in regards to trimming.
2016-08-16 13:22:25 +01:00
Richard W.M. Jones
66816e1133 v2v: Make fstrim warning clearer (RHBZ#1366456).
This reverts the change made for RHBZ#1168144.  The warning is now
always displayed.

It would be nice to make the warning actionable, but there is not a
lot that end users can do since fstrim is such a complex topic
interacting with all filesystem and storage layers.
2016-08-16 13:22:25 +01:00
Richard W.M. Jones
d33e28c988 p2v: Fix s/is/are/ in GUI message.
I reordered the 'and' clause to make it sound a bit more natural.

Thanks: Junqin Zhou.
2016-08-16 13:22:25 +01:00
Tomáš Golembiovský
7eab864c21 v2v: linux: accept 'sr' devices in fstab
Do not print warning for 'sr' devices when converting fstab. Not all
systems create the /dev/cdrom symlink for SCSI CD-ROM devices. Moreover,
on systems with multiple CD-ROMs, having entries for /dev/sr* devices
may be inevitable.

RWMJ: Use String.is_prefix instead of String.find, to more accurately
match on the device name.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2016-08-11 09:00:33 +01:00
Tomáš Golembiovský
68ba0609c7 v2v: Citrix Xen has been tested, adapt the documentation
Conversion from Citrix Xen has now been tested and should work. Remove
the comment about it from the documentation.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-08-11 08:58:30 +01:00
Matteo Cafasso
42bccd78b8 sleuthkit code cleanup
Small cosmetic changes.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-08-08 22:25:04 +01:00
Pino Toscano
8a9c747ff6 sparsify, v2v: use Common_utils.absolute_path
Use the common function for ensuring a path is absolute; it should not
change the behaviour at all.
2016-08-08 17:25:40 +02:00
Pino Toscano
98dea4978d v2v: disk: strip only common extension (RHBZ#1365005)
In disk input mode, to determine the guest name strip the extension from
the filename only if it's a very well extension for disk images.
2016-08-08 17:21:03 +02:00
Richard W.M. Jones
48e4012d03 website: Get rid of some quite old branches.
RHEL 7.3 will have 1.32.6, so we should encourage people to move to at
least that version for recent features.

Fixes commit f4e4a668ae.
2016-08-08 13:57:17 +01:00
Richard W.M. Jones
2c3b829bd8 Version 1.35.0. v1.35.0 2016-08-08 13:46:24 +01:00
Richard W.M. Jones
4c84033d8c Version 1.34.0. v1.34.0 2016-08-08 12:49:58 +01:00
Richard W.M. Jones
f4e4a668ae Update website for 1.34 release. 2016-08-08 12:37:25 +01:00
Richard W.M. Jones
4ad5652c99 Update release notes.
Also remove "draft" logo since these are close to being finalized
for the 1.34 release.
2016-08-08 12:31:15 +01:00
Tomáš Golembiovský
4ddc0add85 v2v: fix regex replacement in grub2_update_console
The replacement string was wrong. There are only two match groups in the
regular expression, not three.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-08-08 11:00:15 +02:00
Tomáš Golembiovský
56e5cf14e9 v2v: do not hide the error, rather report it
The Invalid_argument exception is there to catch unexpected situation
when rpm returns no output. Such situation should be reported rather
then hidden.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-08-05 18:09:10 +02:00
Pino Toscano
34c7215a2f ruby: ignore -Wshift-overflow warnings
There seems to be a -Wshift-overflow bug in a Ruby 2.3 header, so
add a GCC diagnostic override to avoid build failures with
--enable-werror.
2016-08-05 18:09:10 +02:00
Richard W.M. Jones
71de3d49a3 sparsify: Add a regression test for RHBZ#1364347.
Add a regression test for the previous commit.
2016-08-05 15:10:50 +01:00
Richard W.M. Jones
4d5335a56d sparsify: Warn instead of error if a filesystem cannot be fstrimmed (RHBZ#1364347).
Thanks:  Xianghua Chen
2016-08-05 15:10:50 +01:00
Richard W.M. Jones
116a41d048 daemon: fstrim: Turn "discard operation is not supported" into ENOTSUP.
Because we run the external fstrim command we don't have access to the
kernel errno when it fails.  However in the case where it prints this
specific error message, turn that into errno ENOTSUP.
2016-08-05 15:10:50 +01:00
Richard W.M. Jones
97b6b4a4eb sparsify: Exit with error code 3 if fstrim is not supported by the appliance.
This replaces the indirect exception catching from
commit 931aec5b88 with a direct feature
test.

Fixes commit 931aec5b88.
2016-08-05 12:16:54 +01:00
Richard W.M. Jones
7de25f7d71 build: Line up "OCAMLOPT" with other silent rules.
Tidies up commit 0b94c4d3bb.
2016-08-05 10:37:46 +01:00
Richard W.M. Jones
a11a7ebbc3 build: Add silent rules for podwrapper.
Also quietens the podwrapper script itself, as there is no reason to
print 'wrote <output>' for each output file.
2016-08-04 23:33:58 +01:00
Richard W.M. Jones
320b053178 Version 1.33.49. v1.33.49 2016-08-04 22:34:42 +01:00
Pino Toscano
0b94c4d3bb build: add simple custom silent rules for automake
Add makefile variables to enable silent rules for simple command
invocations, such as ocamlc, ocamlopt, javac, and erlc.

This reduces the log output when building with silent rules, still
showing the full command lines otherwise.
2016-08-04 16:18:33 +02:00
Pino Toscano
5630e0eb05 dib: add --drive-format
Allow to specify the format of the helper drive, to avoid relying on the
format autodetection.  This is the same approach used also in all the
other tools.
2016-08-04 14:43:21 +02:00
Pino Toscano
6e198634ac firstboot: make SysV symlinks as relative on Debian
Turn the rc.d symlinks for the guestfs-firstboot service as relative,
instead of absolute paths: the result is the same (the service works the
same), and this way is more coherent with symlinks created by
update-rc.d.
2016-08-04 13:53:31 +02:00
Pino Toscano
d394e01c2b firstboot: rename systemd and sysvinit
Currently we install a systemd service named firstboot.service and a
SysV service named virt-sysprep-firstboot.  On systems where systemd is
the init system and runs with the SysV compatibility, the different
names make systemd handle them as different services, and thus trying to
run the firstboot script runner twice.

Rename both the systemd service and the SysV one to guestfs-firstboot:
the new name is less generic, and allows the systemd service to be
shadowed by the SysV service (and thus running just once).

Also cleanup the old services: the old SysV service can be removed
directly, since its former name had "virt-sysprep" in it, and so there
could not be much room for confusion and conflict.  Regarding the old
systemd service: to avoid leaving it behind, a simple cleanup strategy
is in place, checking the content of the old firstboot.service to really
ensure we are removing one of our versions of this file.
2016-08-04 13:44:03 +02:00
Pino Toscano
1d32637c64 dib: export FS_TYPE for elements
Export FS_TYPE for the elements, so they can know what is the filesystem
created.

This was implemented in diskimage-builder upstream as
commit be521bdec6233530cc952be246a66f1957b0dd58.
2016-08-04 12:16:35 +02:00
Pino Toscano
8ad870e563 dib: add docker output format
Implement the "docker" output format, to import an image into docker.

This was implemented in diskimage-builder upstream as
commit 1187f9d5df6d6eddba478ac75d3834391480755f and
commit edc06a20e57bdf0a9a03949b54395008d73520dc.
2016-08-04 12:16:35 +02:00
Richard W.M. Jones
d14a8f500c Version 1.33.48. v1.33.48 2016-08-04 10:00:06 +01:00
Richard W.M. Jones
9d387b5eeb po: Update POTFILES. 2016-08-04 09:52:07 +01:00
Richard W.M. Jones
9fc0418db5 mllib: _exit should return 'a
Fixes commit 0dfa96c043.
2016-08-04 09:27:43 +01:00
Richard W.M. Jones
bdfce1995b Version 1.33.47. v1.33.47 2016-08-03 16:43:54 +01:00
Pino Toscano
d12be6625a dib: rework run of extra-data.d hooks (RHBZ#1362354)
Instead of running them before lanching the appliance with the disks and
then uploading the result after root.d hooks run, mount the root in the
local temporary directory using FUSE and then run the hooks on the
guest.  Other than being closer to what diskimage-builder does, it also
avoids issues with the extra-data.d scripts assuming to find things
already, and we don't error out while trying to unpack files on the
guest.

Since virt-dib requires FUSE now, build it only if FUSE is supported.
2016-08-03 16:48:11 +02:00
Pino Toscano
5077c02046 mllib: move _exit from v2v as Exit module
Move the OCaml binding to C _exit to an own module.

Just code motion, adapting v2v in the process.
2016-08-03 15:01:59 +02:00
Pino Toscano
2cb053d3fe mllib: check for executable existance in run_command (RHBZ#1362357)
run_command uses Unix.create_process which forks a child process, and
executes execve: the latter fails when the executable does not exist,
triggering the exit which, in older OCaml versions [1], also runs the
at_exit handlers.

Since there is not much that can be done to avoid this on the OCaml
side, to keep run_command working also in older OCaml version then
manually search for the existance of the given executable, exiting with
code 127 (as a shell does) in this case.

[1] http://caml.inria.fr/mantis/view.php?id=7209
2016-08-03 10:07:04 +02:00
Pino Toscano
398b940ea4 mllib: move which and its exception from dib
Rename it from "tool" to "executable" in the process, but otherwise
it is just code motion (with minimal adjustments in dib).
2016-08-03 10:07:04 +02:00
Richard W.M. Jones
c8c181e8d9 launch: libvirt: Autodetect backing format for readonly drive overlays (RHBZ#1354335).
If the user doesn't specify a format (ie. they want autodetection),
and the drive is set to read-only, previously we created a qcow2
overlay to protect the drive but didn't set the backing_fmt field.
However libvirt disabled this so now libvirt doesn't work at all on
qcow2 files that have no backing_fmt field set.

We must therefore do autodetection in libguestfs and use that to set
the backing_fmt field.

We were already doing autodetection in the non-readonly case, so this
commit refactors that code into a new function
("get_source_format_or_autodetect") and uses it on the readonly path
too.
2016-08-02 20:33:57 +01:00
Richard W.M. Jones
3b9cc56a45 v2v: linux: Ignore unused string return value of 'file_owner'.
Because we didn't give the type of 'g' there wasn't sufficient
information for the type checker to pick up this problem.  By
specifying the real type of 'g' in a type annotation, that reveals the
problem.

Thanks: Pino Toscano, Nyoxi on IRC.
2016-08-02 12:11:32 +01:00
Tomáš Golembiovský
75d3c5d3c9 v2v: fixed file_owner function
What was happening in file_owner function did not match the description
in the comment. When a path is owned by multiple packages the returned
string was in fact a concatenation of the names of all packages that own
it. E.g. for `Linux.is_file_owned g inspect "/etc"` the returned value
was "filesystemyum" (i.e. "filesystem" + "yum").

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-08-01 15:37:39 +02:00
Richard W.M. Jones
1d3f075502 v2v: xml: Rename internal xpath_new_context function.
This change is not necessary, but is consistent with the naming scheme
of the rest of the code in this file.
2016-07-31 17:20:08 +01:00
Richard W.M. Jones
9e0022cea8 v2v: xml: Link to libxml2 website.
No change, just finessing the documentation.
2016-07-31 17:04:16 +01:00
Pino Toscano
19b0ae6c65 lvm: do not pass --cache to vgscan
This breaks lvm setups with no lvmetad, and it seems to not be needed
even with lvmetad.

Reverts parts of commit 2c4f154b91.
2016-07-29 17:21:25 +02:00