Commit Graph

9775 Commits

Author SHA1 Message Date
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
Richard W.M. Jones
faff6f23ff lib: uefi: Don't call access(NULL) if no UEFI debug file exists.
Bug found by valgrind on aarch64:

==21350== Syscall param faccessat(pathname) points to unaddressable byte(s)
==21350==    at 0x4F05274: access (access.c:29)
==21350==    by 0x4954DC3: guestfs_int_get_uefi (appliance-uefi.c:90)
==21350==    by 0x49752D7: launch_libvirt (launch-libvirt.c:413)
==21350==    by 0x496FD83: guestfs_impl_launch (launch.c:98)
==21350==    by 0x4902003: guestfs_launch (actions-3.c:145)
[...]
==21350==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
2017-01-18 14:26:46 +00:00
Richard W.M. Jones
d45986d21b lib: Use a common function to validate strings. 2017-01-18 13:35:25 +00:00
Richard W.M. Jones
e035d848f7 mllib: Avoid OCaml local roots corruption.
Because we used 'return' directly, the effect of the CAMLparam0()
macro was not undone, resulting in local roots corruption when the
visit callback throws an exception.

The visit_tests unit test picked this up, but the corruption was only
seen on aarch64.

Fixes commit 4a62e52111.
2017-01-18 10:25:02 +00:00
Richard W.M. Jones
3a160fe16b lib: Add missing <unistd.h> to appliance-uefi.c.
appliance-uefi.c: In function 'guestfs_int_get_uefi':
appliance-uefi.c:67:9: error: implicit declaration of function 'access' [-Werror=implicit-function-declaration]
     if (access (codefile, R_OK) == 0 && access (varsfile, R_OK) == 0) {
         ^~~~~~
appliance-uefi.c:67:5: error: nested extern declaration of 'access' [-Werror=nested-externs]
     if (access (codefile, R_OK) == 0 && access (varsfile, R_OK) == 0) {
     ^~
appliance-uefi.c:67:27: error: 'R_OK' undeclared (first use in this function)
     if (access (codefile, R_OK) == 0 && access (varsfile, R_OK) == 0) {
                           ^~~~
appliance-uefi.c:67:27: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors

Fixes commit dd519e8a8e.
2017-01-17 08:58:00 +00:00
Cédric Bosdonnat
b9f510328a builder: extract Yajl helper functions to yajl.ml
Extract the yajl object_get_* helpers in the Yajl module since this
could be useful for any Yajl user code.
2017-01-05 09:25:11 +01:00
Tomáš Golembiovský
c96bcb4e24 tests: rename guestfs-hashsums.sh to test-utils.sh
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-01-04 10:41:48 +01:00
Tomáš Golembiovský
8644ea7242 v2v: ova: move the untar function
Move the untar function so it can be used later in the code.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-01-04 10:41:48 +01:00
Tomáš Golembiovský
347e4b1648 mllib: compute checksum of file inside tar
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-01-04 10:41:48 +01:00
Pino Toscano
e86b36a31c appliance: add ldmtools/libldm packages on more distros (RHBZ#1409023)
Add them also for Debian and Mageia, where libldm is shipped, and
adjust the comment on the RedHat line.
2017-01-03 17:41:16 +01:00
Pino Toscano
55bf7de97c Update copyright dates for 2017
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2016/$1-2017/g' `git ls-files`

(Thanks Rich for the perl snippet, as used in past years.)
2017-01-03 16:48:21 +01:00
Richard W.M. Jones
dd519e8a8e lib: Move some appliance functions around.
Move some appliance functions out of src/appliance.c and src/launch.c
into separate files.

No functional change, just code movement.
2016-12-24 16:00:07 +00:00
Richard W.M. Jones
61d26f85fc Version 1.35.19. v1.35.19 2016-12-23 22:56:15 +00:00
Richard W.M. Jones
f7bd9bd37f launch: Validate $TERM before passing it through to the kernel command line.
Make sure it is reasonable before we pass it through to the kernel
command line.  I don't believe this is exploitable, but it might cause
obscure bugs.
2016-12-23 21:53:10 +00:00
Richard W.M. Jones
f94cfde5e7 launch: Rationalize how we construct the Linux kernel command line.
This is just code refactoring.
2016-12-23 21:53:10 +00:00
Richard W.M. Jones
764fd3fcc6 appliance: Disable EDD (edd=off) (RHBZ#1404287).
EDD (https://en.wikipedia.org/wiki/Enhanced_Disk_Drive) is a BIOS INT 13h
subcall for communicating the extended size of the boot disk over 8GB
to the OS.  Since libguestfs doesn't use a boot disk, and the
appliance disk is limited to 4GB, and we use virtio-scsi, this is all
useless.

EDD is also broken currently on RHEL 7.3, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1404287

Also the EDD probing takes significant extra time (about 80ms on my
laptop), and using edd=off reduces this time although doesn't entirely
eliminate it.
2016-12-18 20:13:55 +00:00
Pino Toscano
331517d9a3 sysprep: remove anaconda's /root/original-ks.cfg
Remove one more leftover file from anaconda.

Related to: RHBZ#1401320.
Thanks to: Marko Myllynen.
2016-12-15 09:37:01 +01:00
Richard W.M. Jones
adb6a85bf9 Version 1.35.18. v1.35.18 2016-12-14 18:16:16 +00:00
Richard W.M. Jones
b460c50bf5 sysprep: Add new test to EXTRA_DIST.
Fixes commit 3cb43460d3.
2016-12-14 18:14:26 +00:00
Richard W.M. Jones
d131d2af92 sysprep: Add common pod_of_list function to new module 'Utils'. 2016-12-14 17:23:11 +00:00
Richard W.M. Jones
d12636dadd sysprep: Add new operation for removing /etc/passwd- and other backup files (RHBZ#1401320). 2016-12-14 17:15:29 +00:00
Richard W.M. Jones
3cb43460d3 sysprep: Add a new operation to remove editor backup files (RHBZ#1401320).
Remove editor backup files such as *~ and *.bak wherever
they occur within the guest filesystem.

This also includes a test.
2016-12-14 17:15:29 +00:00
Richard W.M. Jones
ca0ce0c2ec mllib: Add a function to test if a guest is "unix-like".
This is not a precise replacement, since we now allow SSH key
injection into Minix, but that is probably correct anyway.
2016-12-14 17:15:29 +00:00
Richard W.M. Jones
2dd2d5cc64 mllib: Add a binding for fnmatch(3) in glibc or gnulib.
This is taken from supermin.
2016-12-14 17:15:29 +00:00
Richard W.M. Jones
4a62e52111 mllib: Add a binding for visit function in cat/visit.c. 2016-12-14 17:15:29 +00:00
Richard W.M. Jones
f87ec46558 v2v: Add a comment about why virt-v2v needs the network.
Only to run unconfigure_vmware ().
2016-12-14 16:52:29 +00:00
Pino Toscano
401e58cba8 tests: drop expected-failing btrfs_subvolume_show test
One of the tests for btrfs_subvolume_show tries to invoke it on the
toplevel subvolume, expecting its failure (since btrfs-progs used to not
be able to list that).  However, since v4.8.3 btrfs-progs can do that
(even if the data returned for that subvolume is limited/incomplete),
and thus this test fails because the API does not fail anymore.

Since we can consider that functionality working (for some kind of it),
then drop this test.
2016-12-14 17:09:32 +01:00
Pino Toscano
7bd6a73f00 libvirt: fix reading secret by usage type
Use the right variable to determine the usage type of a secret.

Fixes commit a94d551345.
2016-12-14 11:09:37 +01:00
Matteo Cafasso
46669d17c5 lib: use guestfs_int_make_temp_path to generate temporary files
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-12-13 18:10:44 +00:00