Commit Graph

9629 Commits

Author SHA1 Message Date
Tomáš Golembiovský
2bed3e4801 appliance: add/remove some packages for Arch Linux
Added:
- cdrtools: added as alternative to cdrkit
- multipath-tools: contains kpartx (in AUR)

Removed:
- ntfsprogs: the package is no longer available, it has been completely
  replaced by ntfs-3g (already in packagelist.in)
- zfs-fuse: no longer in AUR

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-10-11 13:17:25 +01:00
Richard W.M. Jones
d9b2a16c71 v2v: ova: Make OVA directory public readable to work around libvirt bug (RHBZ#1375157).
Only do this if running as root and if the backend is set
to libvirt.
2016-10-11 10:48:24 +01:00
Richard W.M. Jones
9ab8b1bebd launch: libvirt: Remove unused USB and memballoon devices.
Thanks: Laine Stump.

See also:
https://www.redhat.com/archives/libvir-list/2016-October/msg00246.html
2016-10-11 10:39:02 +01:00
Tomáš Golembiovský
d0c86f287d v2v: test Debian/Ubuntu conversion
Enable testing of Debian and Ubuntu guest conversion.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-10-07 16:54:58 +02:00
Pino Toscano
162fe71b8d v2v: linux: enable conversion of Debian guests
A basic conversion of Debian-based guests works now; it needs more
thorough testing for all the operations done with different sources.
2016-10-07 14:55:51 +02:00
Tomáš Golembiovský
52a8202635 v2v: ova: support SHA256 hashes in manifest
The OVF standard allows the use of SHA256 hashes in the manifest file.
Adding support for this.

One of the tests was updated to put SHA256 into manifest file.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-10-07 14:33:48 +02:00
Tomáš Golembiovský
6b7ea3c681 v2v: ova: fix checking of the manifest file
The regular expression for parsing the manifest line was wrong. There is
a mandatory space between '=' and the hash.

Another problem was that only the first line of the manifest file was
actually processed.

Also added some debugging info and warning to catch problems with
parsing.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-10-07 14:33:44 +02:00
Pino Toscano
b9f6eb5132 po: manually update POTFILES-ml
Followup/fix of commit 5681db5ed8 and
commit 7a09db5e48.
2016-10-06 09:22:51 +02:00
Pino Toscano
be8ad60b8e v2v: linux: try to fix removal of VMware tools
Try to improve the way packages of VMware tools are removed from
YUM-based guests:

- when filtering the package itself from its providers, do a stricter
  check so either the provide is the unversioned package, or it is
  exactly its own name

- if the package has no other providers, then going further will cause
  the invocation of 'yum install' with no packages, and thus the package
  itself will not be added to the list of packages to be removed; to
  overcome this issue, just mark the package as "to be removed" in that
  case

Related to: RHBZ#1155150
2016-10-04 14:45:18 +02:00
Pino Toscano
664842763c v2v: linux kernels: remove unused parameter
Remove an unused paramter of the internal check_config function.

Followup of commit 7eb219d193.
2016-10-04 09:40:54 +02:00
Richard W.M. Jones
ca4a679400 appliance: Add ExFAT packages.
Thanks: Miles Wolbe
2016-10-03 14:06:15 +01:00
Pino Toscano
7eb219d193 v2v: linux: check also kernel config for modules
When checking whether a kernel supports virtio or it is Xen-based, it is
assumed that the feature has the kernel module for it; this will fail if
the feature is built-in in the kernel, misrepresenting it.

The solution is to check the kernel configuration whether the feature
is built-in, in case there is no module available.

This fixes the virtio detection on Ubuntu kernels, where virtio is
built in and not as module.
2016-10-03 14:33:20 +02:00
Pino Toscano
52b63e6b33 v2v: linux kernels: detect config file
Add a simple detection for the config file of each kernel, so that can
be used later to get more information on what a kernel provides.
2016-10-03 14:33:20 +02:00
Pino Toscano
19b7495d46 v2v: bootloaders: improve detection of Grub2 default method
Detect only once which method must be used to get and set the default
Grub2 kernel in the guest: this avoids the same checks in list_kernels
and set_default_kernel.

Also, add a "no method" option as well: Debian/Ubuntu guests do not have
neither grubby nor Perl's Bootloader::Tools, so there is no way to know
what is the default kernel, nor to change it.  In this case, add a
warning about this situation.
2016-10-03 14:33:20 +02:00
Pino Toscano
d3736eb0a3 v2v: linux kernels: set type of 'g'
Make sure the type checker can detect the real type of 'g', even when
adding more code using it in detect_kernels.
2016-10-03 10:47:18 +02:00
Pino Toscano
b548c41951 v2v: -i ova: use Checksums
Make use of the Checksums module to ease the verification of the SHA1
checksums in manifests.
2016-10-03 10:41:26 +02:00
Pino Toscano
484c64c29f mllib: add SHA1 support in Checksums
This way Checksums can be used in v2v.
2016-10-03 10:41:26 +02:00
Pino Toscano
a58dff49c5 mllib, builder: add and use Checksums.of_string
Add a simple way to turn a combination of checksum type and value into a
csum_t.  Use it in builder, even if still constrained.
2016-10-03 10:41:26 +02:00
Pino Toscano
7a09db5e48 mllib: move Checksums from builder
Move the Checksums module from virt-builder mostly as it is; the only
change is that on checksum mismatch an exception is raised rather than
invoking "error" directly: this way users of verify_checksum &
verify_checksums can do their own handling of the situation.
2016-10-03 10:41:26 +02:00
Richard W.M. Jones
5681db5ed8 customize: Add --append-line.
This appends a single line to a file, with some cleverness
involving guessing the right line endings to use.

Also adds a test.
2016-10-01 13:08:32 +01:00
Richard W.M. Jones
a31f657db0 daemon: Choose /usr/sbin first for the daemon (debian bug 838995).
Debian is also doing a UsrMove/UsrMerge:
https://wiki.debian.org/UsrMerge

However it is not finalized that Debian will actually make this
change.

Since some Debian systems have /sbin as a symlink and other have /sbin
as a real directory, and we should avoid choosing a symlinked
directory for the daemon, the easiest fix is simply to probe /usr/sbin
before /sbin since under all scenarios (and Fedora too) /usr/sbin is a
real directory.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838995
2016-09-28 11:06:09 +01:00
Pino Toscano
7f236d2201 p2v: add mnemonics to labels and buttons (RHBZ#1379289)
Set mnemonics for all the labels with a text entry or combo box next to
them, and for all the buttons, and check boxes.
2016-09-26 16:04:10 +02:00
Pino Toscano
e3f681e1b8 tools: build common fish sources in a static library
Create a new libfishcommon convenience static library to build just once
(instead of 12 times!) the majority of the guestfish sources used in the
rest of the C tools (mostly for command line stuff, inspection, and
mount).

The notable exceptions not using libfishcommon are guestfish itself, and
virt-rescue: both need to build at least one of the common sources using
additional CPPFLAGS.
2016-09-26 14:16:44 +02:00
Pino Toscano
23ca442f63 fish, inspector: get rid of COMPILING_VIRT_INSPECTOR
All the define was doing in options.h was masking the declaration of
inspect_mount_root, which was always built-in in inspect.c (because of
the unconditional #define there) anyway.

Since this is common code used by all the C tools, try to avoid extra
knobs which add different code paths for no benefit.
2016-09-26 11:45:07 +02:00
Pino Toscano
284c6e1078 build: remove extra libconfig linkage
Some of the C tools were building also config.c as part of the shared
sources from guestfish, and thus bringing a dependency on libconfig.
Since none of them actually read the libguestfs configuration at all,
then exclude fish/config.c from their build, and stop linking to
libconfig.
2016-09-26 11:13:17 +02:00
Pino Toscano
f057086b60 dib: use remove_duplicates instead of own code
Use a common function to remove duplicates in an unsorted list.

Just refactoring, with no behaviour change.
2016-09-23 17:43:07 +02:00
Pino Toscano
d7551ec39b mllib: move remove_duplicates from v2v
Simple code motion.
2016-09-23 17:40:09 +02:00
Richard W.M. Jones
b5d57baf3d Version 1.35.6. v1.35.6 2016-09-23 10:33:20 +01:00
Tomáš Golembiovský
967280566d v2v: linux: correctly reconfigure the initrd on Debian
Using update-initramfs is the native way of updating initrd on Debian
based systems.

To add some modules to the image we can list them in file
/etc/initramfs-tools/modules.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-09-22 18:41:16 +02:00
Pino Toscano
4c3968f262 libvirt: read disk paths from pools (RHBZ#1366049)
A disk of type 'volume' is stored as
  <source pool='pool_name' volume='volume_name'/>
and its real location is inside the 'volume_name', as 'pool_name': in
this case, query libvirt for the actual path of the specified volume in
the specified pool.

Adjust the code so that:
- for_each_disk gets the virConnectPtr, needed to do operations with
  libvirt
- when extracting the disk filename depending on the type, the code
  snippet doing it can directly set 'filename', without setting an XPath
  result variable

Only file-based volumes are supported for now; more types can be added
(with proper testing) later on.
2016-09-22 17:36:09 +02:00
Richard W.M. Jones
a4adf48915 v2v: Support <listen type='socket'> and <listen type='none'> (RHBZ#1378022).
Since libvirt 2.0.0, these two new <listen/> types have been
supported: https://libvirt.org/formatdomain.html#elementsGraphics

This change just copies that configuration over from the source to the
destination if the destination is also libvirt.

Since we previously used 'LNone' to mean "no parseable <listen/>
element" I also had to change previous uses of 'LNone' to 'LNoListen',
so we can use 'LNone' to mean "<listen type='none'>".

Thanks: Ming Xie.
2016-09-21 14:03:23 +01:00
Matteo Cafasso
79fdc9ad47 find_inode: added API tests
NTFS file system always has the MFT file at inode 0. This reliable
information helps testing the API.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-09-19 19:53:07 +02:00
Matteo Cafasso
9eb21ca54a New API: find_inode
Library's counterpart of the daemon's internal_find_inode command.

It writes the daemon's command output on a temporary file and parses it,
deserialising the XDR formatted tsk_dirent structs.

It returns to the caller the list of tsk_dirent structs generated by the
internal_find_inode command.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-09-19 19:53:07 +02:00
Matteo Cafasso
eccce186a3 New API: internal_find_inode
The internal_find_inode command searches all entries referring to the
given inode and returns a tsk_dirent structure for each of them.

The command is able to retrieve information regarding deleted
or unaccessible files where other commands such as stat or find
would fail.

The gathered list of tsk_dirent structs is serialised into XDR format
and written to a file by the appliance.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-09-19 19:53:07 +02:00
Matteo Cafasso
76a2bdd0f1 lib: logic refactoring
Code changes in preparation for new APIs.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-09-19 19:53:07 +02:00
Pino Toscano
6b26a0cce4 OCaml tools: add crypto support (RHBZ#1362649)
Make use of the additional command line arguments, and API needed to
decrypt LUKS partitions.

This affects only virt-customize, virt-get-kernel, virt-sparsify, and
virt-sysprep, as they are the main OCaml tools interacting with
user-provided images.
2016-09-19 19:49:51 +02:00
Pino Toscano
5281e08802 mllib: expose disk decrypt functionalities
Expose via Common_utils the C functions & variables (part of guestfish)
that handle decryption of LUKS partitions, and the additional command
line arguments to tune the way they work.  This way it will be easy to
provide (basic) crypto support also in OCaml-based tools.

Related to: RHBZ#1362649
2016-09-19 19:49:51 +02:00
Pino Toscano
0920b805fd fish: move disk decryption helpers in own file
This way it is easier to use them outside the rest of the code in
guestfish for inspection & mount.

Just code motion, no behaviour changes.
2016-09-19 14:48:19 +02:00
Richard W.M. Jones
21a201051d p2v: Add C<...> around XTerm button string.
Thanks: Pino Toscano.

Fixes commit 2e9d058881.
2016-09-19 12:54:13 +01:00
Richard W.M. Jones
2e9d058881 p2v: Update virt-p2v docs to describe XTerm button (RHBZ#1377081).
Thanks: Tingting Zheng.

Fixes commit bf434bdb35.
2016-09-19 12:32:31 +01:00
Matteo Cafasso
a1b5bbfced daemon: refactor tsk code
Refactor logic in preparation for new APIs.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-09-19 11:12:48 +02:00
Matteo Cafasso
011f29f506 filesystem_walk: fixed root inode listing
With the current implementation, the root inode of the given partition
is ignored.

The root inode is now reported. Its name will be a single dot '.'
reproducing the TSK API.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-09-19 11:12:42 +02:00
Richard W.M. Jones
59999f055b filearch: Return 'i386' instead of 'i486' (as documented).
And some incidental code refactoring.
2016-09-15 16:07:57 +01:00
Richard W.M. Jones
7907abcdc0 filearch: Add architectures missing from the documentation.
Updates commit 68d9b04735
and commit 33d2b4a734.
2016-09-15 16:07:57 +01:00
Richard W.M. Jones
536338ee93 filearch: Sort architectures into alphabetical order in documentation. 2016-09-15 16:07:57 +01:00
Tomáš Golembiovský
85327319ad v2v: linux: detect name of grub2-mkconfig
On Debian family of OSes Grub2 tools are prefixed with 'grub-', not with
'grub2-'. We have to detect the correct name of the tool to use it.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-09-15 16:21:43 +02:00
Richard W.M. Jones
c3bbd129ab Add riscv64 test binaries, and new tests of guestfs_file_architecture. 2016-09-15 15:19:11 +01:00
Richard W.M. Jones
68d9b04735 filearch: Add RISC-V architecture. 2016-09-15 15:19:11 +01:00
Pino Toscano
775e9cbd2a v2v: -o libvirt: always write pool names (RHBZ#1141631)
When creating the XML for the new guest, always put the name of the pool
containing the disks, even when -os specified a pool UUID: libvirt does
not handle pool UUIDs for storage, but only names.
2016-09-15 13:46:25 +02:00
Pino Toscano
f4ca4de207 v2v: -o glance: log glance client version in verbose mode
When running in verbose mode for debugging, run `glance --version` to
print the version of the glance client.  This helps when dealing with
failures, or making its output actionable.
2016-09-14 09:59:12 +02:00