Commit Graph

9592 Commits

Author SHA1 Message Date
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
Pino Toscano
04fe77c519 v2v: -i libvirtxml: tweak warning message
Use a placeholder for the type of disk, so the message becomes exactly
like another warning message used already in this function.
2016-09-14 09:56:04 +02:00
Pino Toscano
1497a9f722 v2v: -o glance: set all properties during creation (RHBZ#1374405)
The glance client v1.0.0 defaults to the Image v2 API: this means that
an image can be referenced only by its UUID, and not anymore by the name
as well (which does not need to be unique).  This caused our glance
invocation to set the properties for the newly created image to fail,
since we are using the name as identifier.

Instead of first creating the image and then setting all the properties
for it, set all the properties when creating the image: other than being
simpler, it also avoid parsing the output of the 'glance image-create'
command for the UUID ('id') of the image.
2016-09-13 16:31:27 +02:00
Richard W.M. Jones
5714439d94 perl: Guestfs.c file is not translatable, don't include it in po/POTFILES.
Reported by Nikos Skalkotos
https://aur.archlinux.org/packages/libguestfs/
2016-09-13 15:27:29 +01:00
Richard W.M. Jones
65e1c66bb9 Version 1.35.5. v1.35.5 2016-09-09 17:46:23 +01:00
Richard W.M. Jones
089f54b0d3 v2v: linux: Use /etc/modprobe.conf.local if it exists.
On SUSE (only) there is /etc/modprobe.conf which is generated from a
/usr/share file.  Local changes are meant to be added to
/etc/modprobe.conf.local.
2016-09-09 17:07:34 +01:00
Richard W.M. Jones
0e1b1ccfb2 v2v: linux: Avoid recursive functions.
Just code motion.
2016-09-09 17:07:34 +01:00
Richard W.M. Jones
15661d8760 v2v: linux: Don't use duck typing in interface of Linux_kernels.
On reflection we want the precise bootloaders type, not some other
object that happens to implement a #list_kernels method.

Fixes commit 2d7fa1db6a.
2016-09-09 17:07:34 +01:00
Richard W.M. Jones
2d7fa1db6a v2v: linux: Move kernel detection to a separate module.
Create a new module [Linux_kernels] which does all kernel detection,
and also provides a place to define the kernel_info data structure.

This is essentially just code motion.
2016-09-09 16:59:28 +01:00
Richard W.M. Jones
171bc5374e v2v: utils: Move external functions together.
Just a small code movement.
2016-09-09 16:09:39 +01:00
Richard W.M. Jones
b7a8247b5a v2v: Move xpath* functions to new module Xpath_helpers.
Just code motion.
2016-09-09 16:09:39 +01:00
Richard W.M. Jones
1ec78f34d8 v2v: Split up 'amend_source' function.
Just code motion.
2016-09-09 16:09:39 +01:00
Richard W.M. Jones
98619f9c26 v2v: -i ova: Derive the name from the OVA filename.
If the guest has no <Name> element in the OVF, previously we chose
"default" as the name.  This changes that so it uses a name derived
from the basename of the OVA file instead.

For example:

  virt-v2v -i ova /path/to/myguest.ova [...]

would use "myguest" as the name (assuming no <Name> was present).

Modifies the behaviour of
commit 1ae4252c93.
2016-09-09 16:09:39 +01:00
Richard W.M. Jones
312379c8a6 v2v: -i disk: Move code that creates name from disk to separate module.
Simple code motion.
2016-09-09 16:09:39 +01:00
Pino Toscano
8335af37fa tests: do not assume '.' is in Perl's @INC
Upstream Perl is going to remove '.' from @INC (the include path for
modules) by default for the next major release (= 5.26) [1], as measure
to fix security issues.  Debian already started backporting the fixes
for this [2], thus behaving this way in current Sid installations.

Since the affected Perl sources are only the local daemon testing
scripts, a simple fix is to force the 'requires' for the local
captive-daemon.pm module to start from the current directory: this way
there is no need to manually augment @INC, and only our local module is
loaded automatically.

[1] https://rt.perl.org/Public/Bug/Display.html?id=127810
[2] https://lists.debian.org/debian-devel-announce/2016/08/msg00013.html
2016-09-09 14:42:05 +02:00
Richard W.M. Jones
839fe4997b daemon: Use reply_with_error instead of *_perror for setfiles command.
Fixes commit 9d205f1c28.
2016-09-09 08:59:46 +01:00
Shahar Havivi
1ae4252c93 virt-v2v: Support for ova exported from AWS (RHBZ#1371843).
1. AWS the name tag is not mandatory - using default as a name
2. AWD doesn't prefix 'ovf:' as prefix to disk path

There is an open bug for oVirt:
https://bugzilla.redhat.com/show_bug.cgi?id=1371843

Signed-off-by: Shahar Havivi <shaharh@redhat.com>
2016-09-08 10:24:56 +01:00
Pino Toscano
12c605f8fa daemon: drop program_name definition
It was previously needed by the 'error' module of gnulib; recent
versions are able to get the name of the current program on their own.
2016-09-08 09:57:15 +02:00
Pino Toscano
eea210dbf7 Use the getprogname gnulib module
Make use of the recently added 'getprogname' module in gnulib: replace
our guestfs_int_program_name with the getprogname() provided by the
module, since it does the same thing, and in a portable way.
As consequence of the above, use gnulib in a couple of tests that use
getprogname().

Since guestfs_int_program_name is gone, drop the configure checks
associated with it.
2016-09-08 09:57:15 +02:00
Pino Toscano
1f65143a42 Update gnulib to latest 2016-09-08 09:57:14 +02:00
Pino Toscano
03032e2419 tests: make test-noexec-stack.pl work in non-English locales
Set C as language when running the script, as the output of readelf is
parsed: this way the parsing works also when the system locale is not
English.
2016-09-08 09:57:14 +02:00
Richard W.M. Jones
be737c9574 Version 1.35.4. v1.35.4 2016-09-02 23:32:01 +01:00
Richard W.M. Jones
c4b7b5d615 erlang: Split up large Erlang extension into smaller C files.
Reduce build times in this directory from about 10s to about 2s.
2016-09-02 23:14:08 +01:00
Richard W.M. Jones
76eee79a65 java: Split up large Java extension into smaller C files. 2016-09-02 23:14:08 +01:00
Richard W.M. Jones
63db9ae81f python: Split up large Python extension into smaller C files.
Reduces build time in this directory from 11s to 3s.
2016-09-02 23:14:08 +01:00
Richard W.M. Jones
d95f1d7102 build: Check generated files are included in the tarball.
When running 'make maintainer-check-extra-dist', check also that all
generated files are included in the tarball.  This is done so that end
users will not need OCaml to compile from tarball releases.
2016-09-02 23:14:08 +01:00
Richard W.M. Jones
20aa0f6496 ruby: Split up large Ruby extension into smaller C files. 2016-09-02 23:14:08 +01:00
Richard W.M. Jones
20f190617a daemon: Split up very large daemon/stubs.c file. 2016-09-02 23:14:08 +01:00
Richard W.M. Jones
a749b5d93a fish: Split up the very large fish/cmds.c file.
Make parallel compiles faster in this directory (about 8s down to 3s).
2016-09-02 23:14:08 +01:00
Richard W.M. Jones
4730f4a918 generator: Generalize the code used to split actions across files.
Previously we used an awkward hack to split up the large src/actions.c
into smaller files (which can benefit from being compiled in
parallel).  This commit generalizes that code, so that we pass a
subsetted actions list to certain generator functions.

The output of the generator is identical after this commit and the
previous commit, except for the UUID encoded into tests/c-api/tests.c
since that is derived from the MD5 hash of generator/actions.ml.
2016-09-02 23:14:08 +01:00
Richard W.M. Jones
f8978239e3 generator: Move all actions into a single list and add filter functions.
This mostly mechanical change moves all of the libguestfs API
lists of functions into a struct in the Actions module.

It also adds filter functions to be used elsewhere to get
subsets of these functions.

Original code         Replacement

all_functions         actions

daemon_functions      actions |> daemon_functions
non_daemon_functions  actions |> non_daemon_functions
external_functions    actions |> external_functions
internal_functions    actions |> internal_functions
documented_functions  actions |> documented_functions
fish_functions        actions |> fish_functions

*_functions_sorted    ... replacement as above ... |> sort
2016-09-02 23:14:08 +01:00
Richard W.M. Jones
71a95becbd generator: Add |> (revapply) operator for compat with OCaml < 4.01. 2016-09-02 23:14:08 +01:00
Richard W.M. Jones
13e47b1218 customize: Add a slow test of --hostname and --timezone settings.
Run these in real guests to ensure they really work.
2016-09-02 23:14:08 +01:00
Richard W.M. Jones
cbb70f1dee customize: Update "unassigned-hostname" etc in Debian/Ubuntu /etc/hosts (RHBZ#1372269).
Commit ab2df2e659 attempted to rewrite
/etc/hosts if it contained the old hostname.

However this wasn't done reliably for a couple of reasons:

(1) Certain Debian/Ubuntu /etc/hostname contains
"localhost.localdomain" but still has "unassigned-hostname" or
"unassigned-hostname.unassigned-domain" in /etc/hosts.

(2) Even if (1) doesn't apply, you still need to split out the
hostname and domainname parts and deal with them separately.
2016-09-02 23:14:08 +01:00
Pino Toscano
e6d9c1b328 build: improve distro check
Use /etc/os-release as first option, translating the distro name to the
current identifier used.  The other options (the release files) are left
as following checks, avoiding them if any matches.
2016-09-02 16:26:38 +02:00
Richard W.M. Jones
56e566af38 v2v: Don't remove Processor and Intelppm nodes (RHBZ#1372668).
Don't remove the Processor and Intelppm nodes since that just breaks
the device driver.

The only remaining node being removed by the original code was
"rhelscsi" (the xenpv-win driver).  I changed this so that instead of
deleting the whole node, it simply disables that driver.  If you look
at RHBZ#737600, it's not even clear that deleting nodes was the right
fix for anything.  I also renamed the function.

Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2016-09-02 14:01:49 +01:00
Richard W.M. Jones
97cbddac12 build: In silent rules, differentiate between .cmi and ocamlc.
Although we happen to use 'ocamlc' to compile .mli files to .cmi,
it is used in a different mode from bytecode compilation.
2016-09-02 12:40:12 +01:00
Roman Kagan
09eb831e8d v2v:windows: prevent conflicts with PnP on firstboot
When put on new virtual hardware Windows will start driver installation
for newly discovered devices.

The problem is that it happens asynchronously and concurrently with
other activities, in particular, the firstboot scripts.  This may result
in conflicts (because a firstboot script may want to install or
uninstall a driver, etc.) and eventually in the system left in
inconsistent state.

In order to prevent it, add another firstboot script which calls a
special utility, pnp_wait, whose sole purpose is to wait until all
PnP-related activities are finished.  (It does so via a WinAPI call
which isn't available from a script so it has to be a compiled .exe.
The source code for it can be found in the corresponding directory in
https://github.com/rwmjones/rhsrvany).  This firstboot script is put
first, so that other firstboot scripts do not have to worry about
interactions with PnP manager any more.

One caveat is that on Windows XP and Windows 2003 the PnP manager always
fires the "Found New Hardware" wizard, which doesn't allow PnP to make
any progress until the user closes it.  As a result, this firstboot
script would never finish.

To work it around, follow the Microsoft KB
(https://support.microsoft.com/en-us/kb/938596) and set up a registry
key to make the the PnP manager not fire the wizard; the key is restored
to its initial state upon PnP completion.  Unfortunately this only works
on systems having the mentioned update installed; otherwise the user
will have to interact with the UI.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Reviewed-by: "Richard W.M. Jones" <rjones@redhat.com>
2016-09-01 11:46:13 +03:00