Commit Graph

9844 Commits

Author SHA1 Message Date
Richard W.M. Jones
fa83b47876 test-data: Use ./run script to run 'guestfish disk-create'.
Commit 74ded0dbc1 changes existing calls
to truncate to run 'guestfisk disk-create' instead.  However this
fails if guestfish has not been installed.  By using the ./run script,
we can use the just-built guestfish instead.

Fixes commit 74ded0dbc1.
2017-02-10 22:41:55 +00:00
Richard W.M. Jones
74660366f6 Version 1.35.22. v1.35.22 2017-02-10 13:38:34 +00:00
Richard W.M. Jones
c99cf0caad v2v: Add result of qemu-img offset/size test to debug output.
Updates commit 3fc9520069.
2017-02-10 13:38:34 +00:00
Richard W.M. Jones
430604ef37 v2v: Fix quoting in external qemu-img command.
Fixes commit 3fc9520069.
2017-02-10 13:38:34 +00:00
Richard W.M. Jones
3a8e2babed contrib: Sort patches into alphabetical order and add to EXTRA_DIST.
We also have to use AM_INIT_AUTOMAKE(tar-pax), since otherwise
automake uses some ancient tar format that doesn't support a filename
this long.  (See: https://noiselabs.io/2010/02/27/tar-file-name-is-too-long-max-99/
for a clear explanation)

Fixes commit b702ec19e8.
2017-02-10 13:08:03 +00:00
Richard W.M. Jones
0a8f95a222 v2v: ova: Further fix test cases.
Updates commit 7461a8fab1.
Fixes and partly reverts commit 8f91d3a9b0.
2017-02-10 12:56:08 +00:00
Richard W.M. Jones
2c340682b5 daemon: selinux: Document cases where setfiles takes a long time to run.
Just adding a comment pointed back to the bug.
2017-02-10 10:14:15 +00:00
Richard W.M. Jones
b702ec19e8 contrib: p2v: Add scripts to build and test virt-p2v ISOs with RHEL 5, 6.
This adds a contrib script which can be used to build the virt-p2v ISO
on top of RHEL 5 or RHEL 6, i686 (32 bit) or x86-64 (64 bit) base.

There is also a script for testing the ISOs produced this way.
2017-02-09 17:52:45 +00:00
Richard W.M. Jones
4ab07a9949 builder: templates: Call sync after running virt-install.
I don't think this will really make any difference.  However there is
some puzzling disk corruption in the recently built RHEL 5 & 6 i686
images, and I want to make absolutely sure they are not caused by an
unsynchronized disk image.
2017-02-09 17:52:45 +00:00
Richard W.M. Jones
eeb3f42d1f builder: templates: Add 32 bit (i386) templates for RHEL 5 and 6. 2017-02-09 13:54:46 +00:00
Richard W.M. Jones
d74ed7b122 p2v: Fix RHEL URLs in kickstart.
Also make the repo directives use the --proxy flag if specified and
supported.
2017-02-09 13:54:46 +00:00
Richard W.M. Jones
3e7e6d95c1 p2v: Fix virt-p2v-make-kickstart when run from local directory.
It was looking for the binary in p2v/virt-p2v/virt-p2v.xz.  This fix
makes it look for the correct path p2v/virt-p2v.xz.
2017-02-08 17:44:47 +00:00
Richard W.M. Jones
3fc9520069 v2v: ova: Don't rely on qemu-img version, test "offset" and "size" features.
See:

https://www.redhat.com/archives/libguestfs/2017-February/msg00064.html
2017-02-08 12:47:17 +00:00
Richard W.M. Jones
a1bc37d673 p2v: Document sources of ssh/session timeout problems. 2017-02-08 12:47:17 +00:00
Richard W.M. Jones
2f97cd5517 p2v: Send ping packets every 5 minutes to sshd.
Also drop the connection if no response at all has been received after
30 minutes.

This action should prevent firewall timeouts from causing virt-p2v to
fail (see this thread:
https://www.redhat.com/archives/libguestfs/2017-February/msg00010.html).

Thanks: Tomáš Golembiovský
2017-02-08 12:47:17 +00:00
Richard W.M. Jones
27b64f8227 p2v: Use the ADD_ARG macro to simplify ssh/scp parameters.
No functional change.
2017-02-08 12:47:17 +00:00
Richard W.M. Jones
0de08f6527 daemon: Allow ADD_ARG macro to be used everywhere.
This is a simple macro with no dependencies.  Allow it to be used from
any program.
2017-02-08 12:47:17 +00:00
Richard W.M. Jones
4983084b8c resize: tests: Remove comment.
Doesn't look like we'll handle extended partitions any time
soon, so remove comment.
2017-02-08 12:04:23 +00:00
Richard W.M. Jones
23878acbbd builder: tests: Disable valgrind for test with multi-line parameters.
Breaks libtool, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1420301

This updates commit 736a8465a6.
2017-02-08 11:58:34 +00:00
Richard W.M. Jones
736a8465a6 valgrind: Add libtool to the @VG@ macro.
There were still a few places where we were testing bash rather than
the intended program.  Add `libtool --mode=execute' to the beginning
of the @VG@ macro to try to get around this.
2017-02-08 10:30:58 +00:00
Richard W.M. Jones
6ec23eeac0 Version 1.35.21. v1.35.21 2017-02-07 22:01:07 +00:00
Richard W.M. Jones
0276b3e246 v2v: ova: Add various test data files to EXTRA_DIST.
Fixes commit 8f91d3a9b0.
2017-02-07 21:54:33 +00:00
Richard W.M. Jones
f73ac1fc9c v2v: Skip one test because virt-v2v -i ova can break with libvirt backend.
See:
https://www.redhat.com/archives/libguestfs/2017-February/msg00101.html
2017-02-07 21:13:57 +00:00
Richard W.M. Jones
74ded0dbc1 RHEL 5: tests: Don't use 'truncate' command.
The coreutils 'truncate' command does not exist in RHEL 5.  Replace
use of this command in tests with the guestfish 'disk-create' command.
2017-02-07 18:51:53 +00:00
Richard W.M. Jones
7461a8fab1 v2v: ova: Normalize the output in test case.
Fixes commit 8f91d3a9b0.
2017-02-07 18:51:52 +00:00
Richard W.M. Jones
fa6016af19 p2v: Use socket activation with qemu-nbd and nbdkit.
If supported, use socket activation to pass a pre-opened listening
socket to the NBD server.  This means we can guarantee to choose an
unused port even if there are multiple instances of virt-p2v running
(ie. when testing) or if there are unexpected services running on the
same machine.

This change applies to both NBD servers, since both now (or will
shortly) support this feature.
2017-02-07 15:57:04 +00:00
Richard W.M. Jones
2e0c33a7b9 p2v: Don't hard code "localhost" (NBD listening address) everywhere.
No functional change.
2017-02-07 15:57:04 +00:00
Richard W.M. Jones
4dd4a9b1a6 p2v: Move nbd_local_port to nbd.c.
In preparation for using socket activation, move the nbd_local_port
global inside nbd.c and make it private.

This is largely code motion.  However I rearranged the order in which
the ssh data connection and the NBD server are started up.  Previously
the ssh connection was made first, and the NBD server was then
started.  Now the NBD server starts first.  This happens so that nbd.c
can choose the local port, and when we implement socket activation it
will allow nbd.c to open the socket and choose a free port too.
2017-02-07 15:57:04 +00:00
Richard W.M. Jones
cdd8dc4145 p2v: Clean up ugly implementation of --nbd option.
The previous implementation was pretty ugly.  This reimplements things
a bit more cleanly.
2017-02-07 15:57:04 +00:00
Richard W.M. Jones
d9ab95ec16 p2v: Move NBD-related functions into a separate file.
This is almost pure code motion, but I changed the name and prototype
of the function 'wait_nbd' to make its purpose clearer, and to remove
the unnecessary timeout setting (which is hard-coded).
2017-02-07 15:57:04 +00:00
Pino Toscano
8a2b0738d1 resize: support non-local output disks (RHBZ#1404182)
Parse the output disk as URI, and use all its attributes just like
it is done for the input disk.  The only change is that the fsync of the
output disk is limited now for local URIs only, since it will not work
with remote protocols.
2017-02-06 16:36:29 +01:00
Richard W.M. Jones
10a5567dc7 lib: g->program is now never the empty string.
The getprogname module either sets g->program to a string derived from
argv[0] or fails at compile time.

Fixes commit eea210dbf7.
2017-02-06 12:22:49 +00:00
Pino Toscano
c1bd2c3e74 dib: add tgz output format
Implement the "tgz" output format, i.e. "tar" compressed as gzip.

This was implemented in diskimage-builder upstream as
commit da41ee6012b064aa6901c871a1104a3a3933117e.
2017-02-06 10:09:59 +01:00
Pino Toscano
91646e0bb6 dib: clarify "output:" lines in --machine-readable documentation 2017-02-06 10:09:59 +01:00
Pino Toscano
35f29deacc dib: refactor output formats handling
Implement a system similar to the operations in virt-sysprep, so each
output format has its own file and attributes (such as command line
arguments).

The result is that there is no more need to spread everywhere the job
required by each output format, such as checking for tools, or hooking
at the right point.
2017-02-06 10:09:58 +01:00
Pino Toscano
00ecda5d9c dib: pass custom mkfs options after the filesystem type
Make sure they are handled as options for the actual mkfs driver,
instead of mkfs itself.  Also, improve the documentation of
--mkfs-options accordingly.

This was fixed in diskimage-builder upstream as
commit 5e2330d89c6c0e55b270464abea7e99a4d3246ad.
2017-02-06 10:09:58 +01:00
Pino Toscano
380fd71dc8 dib: add --checksum
Add a new option to create files with the MD5 and SHA512 checksums of
all the disk image types produced.

This was implemented in diskimage-builder upstream as
commit 2ea5feca5c4b64867ac327736edfb20408f8840e and
commit 22952b7ea0543bb4f446752976d1d8ba232b021a.
2017-02-06 10:09:58 +01:00
Pino Toscano
bc06d59855 dib: clear up "already provided" message
Improve the error message that is shown when trying to selecting an
element, and another element provides it.

This was implemented in diskimage-builder upstream as
commit 452f7b8d5aaa6e85e3b01b970cd9cbc842b34b86.
2017-02-06 10:09:58 +01:00
Pino Toscano
ab0cf0012f fuse: use the configured program name
When initializing FUSE, use the program name as set (either
automatically or manually) in the guestfs handle.
2017-02-06 10:09:58 +01:00
Richard W.M. Jones
5657d4726d v2v: Use failwithf instead of failwith (sprintf ...) 2017-02-04 15:50:26 +00:00
Richard W.M. Jones
a11040d9cd v2v: Use failwith/failwithf instead of raise (Failure ...)
Minor refactoring of ommit d3c93e3320.
2017-02-04 15:47:43 +00:00
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