Commit Graph

9803 Commits

Author SHA1 Message Date
Tomáš Golembiovský
8f91d3a9b0 v2v: ova: don't extract files from OVA if it's not needed
We don't have to always extract all files from the OVA archive. The OVA,
as defined in the standard, is plain tar. We can work directly over the
tar archive if we use correct 'offset' and 'size' options when defining
the backing file for QEMU. This puts much lower requirement on available
disk space.

Since the virt-v2v behaviour for OVA input now depends on QEMU version
available this affects some of the tests. Expected result of the
affected also has to depend on the QEMU used thus such tests will have
two *.expected files.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-02-04 15:13:29 +00:00
Tomáš Golembiovský
d3c93e3320 v2v: add function find_file_in_tar to utils
The function looks up file in tar archive and returns a tuple containing
which at byte it starts and how long the file is.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-02-04 15:13:29 +00:00
Tomáš Golembiovský
3839b0be5b v2v: add function qemu_img_version to utils
The function returns version of qemu-img as a tuple (major, minor), or
the value (0,9) in case there was an error detecting the version.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-02-04 15:13:29 +00:00
Tomáš Golembiovský
e9eb3a79da mllib: add subdirectory function to common_utils
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-02-04 15:13:29 +00:00
Richard W.M. Jones
152657178d generator: Move failwithf to mllib.
A useful function.  This is just code motion.
2017-02-04 15:13:29 +00:00
Richard W.M. Jones
2b5173712b v2v: Further increase memory allocated to the appliance (RHBZ#1418283).
In commit 08f82f2e3d we increased the
memory size to 800MB (on x86) so that the semodule command would work.

However it has been discovered that another SELinux command takes
large amounts of RAM (setfiles during the SELinux relabel step).
Therefore increase the memory size again, this time to 2000MB.
2017-02-02 09:36:56 +00:00
Richard W.M. Jones
d5383ca066 docs: Document that virt-p2v can use qemu-nbd or nbdkit.
Fixes commit 4af9081e0d.
2017-02-01 12:24:21 +00:00
Richard W.M. Jones
889386f8c6 uefi: Remove references to kraxel's old edk2 builds.
As noted in the source code, these were due to be removed at
the end of 2016.
2017-01-31 19:26:07 +00:00
Tomáš Golembiovský
c465e794b2 v2v: ova: don't detect compressed disks, read the OVF instead
The information whether the disk is gzip compressed or not is stored
in the OVF. There is no reason to do the detection.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-01-31 12:01:12 +00:00
Richard W.M. Jones
2e5033349a configure: Fix release date of 1.35.20.
Fixes commit 7b6b9d9bea.
2017-01-31 11:01:26 +00:00
Richard W.M. Jones
d5752538bf common/miniexpect: Add README and miniexpect.pod from upstream. 2017-01-29 18:12:43 +00:00
Richard W.M. Jones
e79a2af219 generator: Make 'main.ml' clearer.
- Make module name explicit, so it's more obvious which module a
  function is defined in.

- Group lines of code by feature.

- Capitalize some module names properly.

Just code motion, no functional change.
2017-01-29 17:32:22 +00:00
Richard W.M. Jones
c9a51b2fd2 po: Really ignore perl/lib/Sys/Guestfs.c (RHBZ#1417444).
Incorrect grep expression meant this file was not being ignored
before.

Thanks: Marius Cirsta
2017-01-29 13:34:03 +00:00
Richard W.M. Jones
48d4117789 fish: Handle changed type of 'len' parameter in gperf 3.1 (RHBZ#1416941).
Commit 004de6cf45 was not sufficient to
solve this problem.  We are also using gperf in guestfish.  Rewrite
the code in the same way to avoid having to prototype the hash
function.
2017-01-28 13:23:40 +00:00
Richard W.M. Jones
7b6b9d9bea Version 1.35.20. v1.35.20 2017-01-27 13:02:36 +00:00
Richard W.M. Jones
4733cb6cea p2v: Add a test for virt-p2v with nbdkit. 2017-01-27 09:42:01 +00:00
Richard W.M. Jones
4af9081e0d p2v: Allow nbdkit as an alternative NBD server to qemu-nbd.
Add code in virt-p2v so that it can use nbdkit (with the file plugin)
as an alternative to qemu-nbd.

This is controlled through the virt-p2v --nbd command line option,
allowing you to select which server (out of qemu-nbd or nbdkit) you
prefer (with a fallback).  The default is: --nbd=qemu-nbd,nbdkit so
qemu-nbd will be used preferentially.
2017-01-27 09:42:01 +00:00
Richard W.M. Jones
57d1e55374 p2v: In non-ISO environment, don't use hard-coded port 50123.
When testing virt-p2v (eg. on the host machine) this prevents us from
testing two instances of virt-p2v at the same time because both will
try to use the same port.
2017-01-27 09:42:01 +00:00
Richard W.M. Jones
535e6f5ebb tests/mount-local, tests/parallel: Use srandom (time (NULL) + getpid ()).
If two instances of the test start at exactly the same time, they
would have the same random number seed.
2017-01-27 09:42:01 +00:00
Richard W.M. Jones
5d607f752b common/edit: Don't use random() function.
Generate the random filename using our utility function
guestfs_int_random_string.  This also means that we will not need to
call srandom() in guestfish or virt-edit.
2017-01-27 09:42:01 +00:00
Richard W.M. Jones
004de6cf45 errnostring: Handle changed type of 'len' parameter in gperf 3.1 (RHBZ#1416941).
The prototype of the hash function changed in gperf 3.1:

* The 'len' parameter of the hash function and of the lookup function is now
  of type 'size_t' instead of 'unsigned int'. This makes it safe to call these
  functions with strings of length > 4 GB, on 64-bit machines.

This commit moves the guestfs_int_string_to_errno function into the
third (functions) section of the gperf file so it is able to use the
lookup function without needing a prototype.

Thanks: Marius Cirsta
2017-01-27 09:36:50 +00:00
Richard W.M. Jones
00a2b689b3 Revert "errnostring: Handle changed type of 'len' parameter in gperf 3.1 (RHBZ#1416941)."
This reverts commit 3a2b89a09e.
2017-01-27 09:31:40 +00:00
Richard W.M. Jones
3a2b89a09e errnostring: Handle changed type of 'len' parameter in gperf 3.1 (RHBZ#1416941).
The prototype of the hash function changed in gperf 3.1:

* The 'len' parameter of the hash function and of the lookup function is now
  of type 'size_t' instead of 'unsigned int'. This makes it safe to call these
  functions with strings of length > 4 GB, on 64-bit machines.

This change tries to detect the required type in ./configure

Thanks: Marius Cirsta
2017-01-26 22:07:23 +00:00
Richard W.M. Jones
8ee97b8859 p2v: Move miniexpect library to common/miniexpect.
No change, just code motion.
2017-01-26 15:05:47 +00:00
Richard W.M. Jones
db48870cf3 df: Move framework for processing domains in parallel to common/parallel.
Just code motion.
2017-01-26 15:05:47 +00:00
Richard W.M. Jones
a8c5739fd2 fish: Move edit, progress, windows under common/
Three more pieces of common code are moved under the common/
subdirectory.  This is just code motion.

Note that windows.[ch] wasn't even being used by guestfish.  That code
was only used in other virt tools.
2017-01-26 15:05:47 +00:00
Richard W.M. Jones
a9199a46b1 fish: Move fishcommon library to common/options.
This is mostly code motion but:

(1) I had to remove the compile-time COMPILING_GUESTFISH and
COMPILING_VIRT_RESCUE macros and replace them with runtime constants
and checks.

(2) I moved the fish/config.c file into this library.
2017-01-26 15:05:47 +00:00
Richard W.M. Jones
779bc1de23 cat: Move visit library to new directory common/visit.
Just code motion.
2017-01-26 15:05:46 +00:00
Richard W.M. Jones
f161c9ea57 Rename src/ to lib/ 2017-01-26 15:05:46 +00:00
Richard W.M. Jones
b53cec584d lib: Move utilities to new directory common/utils.
Just code motion.

This commit makes it clearer what is a utility and what is part of the
library.  It also makes it clear that we should rename:

  guestfs-internal-frontend.h -> utils.h
  guestfs-internal-frontend-cleanups.h -> cleanups.h (?)

but this commit does not make that change.
2017-01-26 15:05:46 +00:00
Richard W.M. Jones
88c0ce2397 lib: Share common protocol and errnostring libraries with the library and daemon.
This commit, which is just code motion, moves the common XDR protocol
code (libprotocol) and the common errno handling (liberrnostring) into
libraries which are each built once and shared between the library and
daemon.
2017-01-26 15:05:46 +00:00
Richard W.M. Jones
e285566369 gobject: Avoid multiply defined CLEANFILES.
The error is:

gobject/docs/gtk-doc.make:52: warning: CLEANFILES multiply defined in condition TRUE ...
gobject/docs/Makefile.am:95:   'gobject/docs/gtk-doc.make' included from here
common-rules.mk:28: ... 'CLEANFILES' previously defined here
gobject/docs/Makefile.am:18:   'subdir-rules.mk' included from here
subdir-rules.mk:20:   'common-rules.mk' included from here
2017-01-26 15:05:46 +00:00
Richard W.M. Jones
84254bf739 p2v: Don't inhibit D-Bus support for modern systems.
Fixes commit c526afbe95.
2017-01-26 14:39:03 +00:00
Richard W.M. Jones
c90baa812a p2v: gtk: Update docs/C_SOURCE_FILES.
Updates commit 17cc502d9b.
2017-01-25 12:30:25 +00:00
Pino Toscano
571269bf72 p2v: log also environment on conversion server
Save the content of the environment on the conversion server, so it is
one additional help when debugging failed conversions.
2017-01-23 09:44:32 +01:00
Richard W.M. Jones
718ce7964c RHEL 5: p2v: Ignore garbage when decoding base64 sections in kickstart.
RHEL 5 base64 utility requires this flag to ignore newlines in input.
2017-01-21 13:54:02 +00:00
Richard W.M. Jones
ae160215ca RHEL 5: p2v: Workarounds for limited partial match support in ancient PCRE.
In the ancient version of PCRE in RHEL 5, partial match support does
not support /.*/, returning PCRE_ERROR_BADPARTIAL.  However the
equivalent regular expression /(?:.)*/ works fine, so use that
instead.
2017-01-21 10:24:40 +00:00
Richard W.M. Jones
17cc502d9b p2v: gtk: Move Gtk compat macros into separate files.
Just code motion.
2017-01-21 09:56:21 +00:00
Richard W.M. Jones
9ceb0cca05 p2v: Include file and line number in internal errors. 2017-01-21 09:46:04 +00:00
Richard W.M. Jones
a77ef0e7c8 RHEL 5: p2v: Compile GUI for ancient Gtk 2.10.
RHEL 5 has ancient Gtk 2.10 which lacks several functions and whole
features we need (eg the spinner).  Add various macros and function
definitions to work around this.
2017-01-21 09:46:04 +00:00
Richard W.M. Jones
c526afbe95 RHEL 5: p2v: Don't compile inhibit support if dbus doesn't support FD passing.
Since RHEL 5 doesn't have systemd, inhibit isn't supported anyway, so
compiling it out is no problem.
2017-01-21 09:46:04 +00:00
Richard W.M. Jones
035d839601 RHEL 5: p2v: Skip partial match checking when PCRE_INFO_OKPARTIAL is not defined.
This test is only a sanity check, so skip it when pcre doesn't define
this symbol.
2017-01-21 09:46:04 +00:00
Richard W.M. Jones
4f102b6832 p2v: Document lscpu, lspci, lsscsi, lsusb files.
Updates commit 5f0bcc3057.
2017-01-20 13:48:56 +00:00
Richard W.M. Jones
5f0bcc3057 p2v: Add more debugging information: lscpu, lspci, lsscsi, lsusb.
Dump extra information from the source physical machine to help with
debugging.
2017-01-20 09:51:31 +00:00
Richard W.M. Jones
1aefcbcc9b daemon: Add comment explaining why we remove 'p' character.
No code change, just a comment.

Updates commit 6fd2ddb350.
2017-01-19 12:06:25 +00:00
Pino Toscano
5b02e7e6df daemon: Return MD partitions in guestfs_list_partitions (RHBZ#1414510). 2017-01-19 12:03:55 +00:00
Pino Toscano
6fd2ddb350 daemon: Fix part-to-dev when the partition name includes p<N>.
If the device name ends with a number, Linux uses partition names of
the form <device>p<N>.  Handle this case by knocking off the 'p'
character.
2017-01-19 11:00:21 +00:00
Richard W.M. Jones
5c350db94d tests: Add unit tests for guestfs_canonical_device_name. 2017-01-19 09:16:52 +00:00
Richard W.M. Jones
4fa7df3ed7 canonical_device_name: Don't rewrite /dev/mdX as /dev/sdX (RHBZ#1414682).
The guestfs_canonical_device_name API was rewriting /dev/mdX as
/dev/sdX.  This is wrong since (eg) /dev/sd0 is not a device name, so
if you pass the canonicalized name back to the API it will fail.
virt-v2v was one tool doing this.
2017-01-19 09:15:16 +00:00
Richard W.M. Jones
4a9af91e36 aarch64: launch: direct: Use virtio-pci devices.
qemu-system-aarch64 -M virt now supports virtio-pci devices.  These
are considerably faster than virtio-mmio so use them by default.
2017-01-18 14:26:46 +00:00