9929 Commits

Author SHA1 Message Date
Richard W.M. Jones
814786334e Version 1.35.28. v1.35.28 2017-02-24 13:08:50 +00:00
Richard W.M. Jones
ba1e9f8bfc docs: Begin updating release notes for libguestfs 1.36. 2017-02-24 13:08:37 +00:00
Pino Toscano
8066b34b60 inspect: read more fields for RPM packages
In particular, read the URL, and both the summary and the description.
2017-02-24 14:01:31 +01:00
Pino Toscano
ca997dce6c inspect: read more fields for Debian packages
In particular, read the URL, the source name, and both the summary and
the description.  For the long description, add a small system to read
continuation lines.

Adapt the expected result of virt-inspector for Debian and Ubuntu phony
guests, so test-virt-inspector.sh still passes.
2017-02-24 14:01:31 +01:00
Pino Toscano
a920c94870 inspect: add source and summary to internal add_application
This way source and summary can be specified for any package read from
the guest.
2017-02-24 14:01:31 +01:00
Richard W.M. Jones
8e6f6305c2 po-docs: Fix mistranslated message in Ukrainian file.
A message was translated without the trailing \n.  As it was in a
verbatim section of POD, I actually reverted the whole translation.

The error was:

  ./uk.po:53533: 'msgid' and 'msgstr' entries do not both end with '\n'
  msgfmt: found 1 fatal error

In fact po4a (or whatever calls msgfmt) seems to ignore the error and
continues which is another problem.

Fixes commit 794b6a1acf.
2017-02-24 12:54:06 +00:00
Richard W.M. Jones
1e2555c1b8 po-docs: Add cs to lingas_not_translated.
Commit 794b6a1acf added cs.po, but
because this wasn't also added to lingas_not_translated the file was
not included in EXTRA_DIST or processed properly.

Fixes commit 794b6a1acf.
2017-02-24 12:53:42 +00:00
Richard W.M. Jones
7d0ed596c2 po-docs: ja: Fix internal link L</...> which was translated.
Compiling po-docs/ja/guestfish.pod failed with:

  Pod input around line 277: L<> starts or ends with whitespace
  Pod input around line 362: L<> starts or ends with whitespace

I reverted the part of the L</...> link which had been translated.

The fix isn't quite correct -- headings *can* be translated, and the
corresponding internal links should be translated too.  However
pod2man has problems dealing with such links and in any case the
partial translation was not correct, so revert to the English version
of the link.

Updates commit 794b6a1acf.
2017-02-24 12:36:45 +00:00
Richard W.M. Jones
57d17ca301 mllib: visit: Initialize CAMLlocal-allocated value.
Somewhere between OCaml 4.01 and OCaml 4.04, <caml/memory.h> changed
the way that CAMLlocalX() values on the stack are initialized.  In
OCaml 4.01:

  #define CAMLlocal1(x) \
    value x = 0; \
    CAMLxparam1 (x)

but in OCaml 4.04:

  #define CAMLlocal1(x) \
    value x = Val_unit; \
    CAMLxparam1 (x)

The code in mllib/visit-c.c assumed that the value would be
initialized to Val_unit, and used a check (exn != Val_unit) to see if
the value had been updated.  This failed badly (with a segfault) on
OCaml 4.01 in Debian 8.

Resolve this by always initializing CAMLlocalX() values before use.
2017-02-24 04:59:57 -05:00
Richard W.M. Jones
8b950deb26 v2v: Add a utility function for testing if the backend is libvirt.
This also fixes one of the places where we checked this so it now
recognizes both "libvirt" and "libvirt:...".
2017-02-24 09:05:30 +00:00
Richard W.M. Jones
ad9e9c98b5 v2v: Rename Domainxml -> Libvirt_utils.
The name 'Domainxml' made no sense.
2017-02-24 09:05:30 +00:00
Richard W.M. Jones
94f44b9983 v2v: ova: Move libvirt version test to input_ova.ml.
Updates commit 90521da5d4.
2017-02-24 09:05:30 +00:00
Richard W.M. Jones
df2006b275 v2v: -i libvirt: Fix test for "json:" backing file support.
Thanks: Tomáš Golembiovský for pointing out the error and
showing how to fix it.
2017-02-23 15:42:15 +00:00
Tomáš Golembiovský
560a3682c6 v2v: tests: restore disabled OVA test
We are redy to restore the disabled test. The relevant libvirt fixes
should be available in 3.1.0.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-02-23 15:42:15 +00:00
Tomáš Golembiovský
90521da5d4 v2v: ova: check libvirt version before OVA import
Libvirt < 3.1.0 lacks enough support for json: pseudo-URLs. Notably it
does not allow use of "raw" driver that we need.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-02-23 15:42:15 +00:00
Tomáš Golembiovský
2dbf6bd7b7 v2v: ova: fix generated JSON for libvirt support
We have to be explicit about the drivers in backing file JSON in order
for libvirt to work.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2017-02-23 15:07:54 +00:00
Richard W.M. Jones
794b6a1acf Update translations from Zanata. 2017-02-23 15:07:46 +00:00
Richard W.M. Jones
45e046dac9 tests: Disable some tests so they don't break when ./configure --without-libvirt 2017-02-23 13:59:38 +00:00
Richard W.M. Jones
a7bd499244 tests: regressions: Ignore SIGPIPE in test.
The test tests/regressions/rhbz914931.c works by causing the daemon to
segfault while writing to it.

For reasons unknown, when configured --without-libvirt, this causes
the test to fail receiving SIGPIPE (exit code 141).  We can prevent
this by installing a signal handler to ignore SIGPIPE, so the signal
is converted to EPIPE which the code handles properly.
2017-02-23 13:59:22 +00:00
Richard W.M. Jones
c72be578c1 debian: Old qemu-img does not support -f raw -o preallocation=off
The old version of qemu-img available in Debian 8 doesn't support the
preallocation option for raw format.  However this doesn't matter
because the default is preallocation=off (ie. sparse) for old and new
versions of qemu-img so we can just omit this parameter.

Fixes commit 53317e3f07
and commit fa83b47876
and commit 74ded0dbc1.
2017-02-23 13:52:25 +00:00
Richard W.M. Jones
bf7aab615b v2v: Fix incorrect test skip.
The test should be skipped *if* uml, not unless uml.

Fixes commit a1b3d8d04b.
2017-02-23 12:52:13 +00:00
Richard W.M. Jones
e53418558a v2v: windows: Only warn on RHEV-APT if requested, install VMDP unconditionally.
Slightly change the logic for installing RHEV-APT and VMDP:

- Only warn on failure to install RHEV-APT if the output hypervisor
  requested it.  Otherwise the warning is pointless because RHEV-APT
  can't be used anyway.

- Make the warning clearer and actionable.

- Try to install VMDP unconditionally (rather than only if RHEV-APT
  failed).  It is always useful for SuSE hosts.  However don't warn if
  it's not available.
2017-02-23 09:25:49 +00:00
Richard W.M. Jones
83488cb6f3 v2v: windows: Simplify installing pnp_wait.exe.
Updates commit 09eb831e8d.
2017-02-23 09:18:28 +00:00
Richard W.M. Jones
cf85da5b7e v2v: Add fake test-data/fake-virt-tools/pnp_wait.exe for testing.
Analogous to commit f5c9357c8e.
2017-02-23 09:10:15 +00:00
Richard W.M. Jones
7a4234088b Version 1.35.27. v1.35.27 2017-02-22 22:15:53 +00:00
Richard W.M. Jones
990241f023 v2v: windows: Only try to install rhev-apt if the target is RHV (RHBZ#1161019).
Thanks: Tingting Zheng
2017-02-22 22:15:21 +00:00
Richard W.M. Jones
f5c9357c8e v2v: Add fake test-data/fake-virt-tools/vmdp.exe for testing. 2017-02-22 21:16:07 +00:00
Richard W.M. Jones
c280df7a4d v2v: windows: Simplify installing rhev-apt.exe or vmdp.exe.
This just simplifies the code and should make no functional
difference.

Updates commit c466d4cb92.
2017-02-22 21:16:07 +00:00
Richard W.M. Jones
4b465468b1 v2v: Pass output object into the conversion module.
Previously the Convert_linux conversion module depended on one feature
of the output module (#keep_serial_console).  This was extracted in an
ad-hoc way from the output module and passed as an extra parameter to
the conversion module.

Instead of doing it this way, just pass the output module into the
conversion module, so it can call output#keep_serial_console itself.

This is just a simplification of the existing code, but otherwise adds
no new features.
2017-02-22 21:16:01 +00:00
Pino Toscano
00bac2e5da inspect: ignore /dev/cdN devices in /etc/fstab
Non-Linux Unix guests may have static devices for CDs, so make sure to
skip them when reading /etc/fstab.  This is the same as done for
/dev/fdN devices, i.e. floppy devices.
2017-02-22 18:57:33 +01:00
Richard W.M. Jones
24d2150047 v2v: vCenter: Remove proxy environment variables (RHBZ#1354507).
Currently imports from vCenter sometimes obey proxy environment
variables (eg. $http_proxy) and sometimes don't.  The initial libvirt
connection to fetch metadata never uses the proxy, but because the
subsequent conversion and copying uses libcurl, it will pick up on
proxy environment variables.

This makes no sense, and in any case vCenter is really slow as it is
without putting another device into the data path.  Therefore ensure
that libcurl does not see any proxy environment variables by unsetting
them.
2017-02-22 15:28:40 +00:00
Richard W.M. Jones
592c960c15 mllib: Add unsetenv(3) binding to Unix_utils.
Missing from the OCaml stdlib.  This implementation is the same as the
one in Jane St's Core, except we don't bother to throw an exception on
error.
2017-02-22 15:28:40 +00:00
Richard W.M. Jones
4b6a482bc8 mllib: Combine small Unix library call bindings into Unix_utils module.
Concatenate six small modules containing Unix/POSIX library call
bindings into a single module called Unix_utils.

The previous modules and the library functions bound were:

 - Dev_t:   makedev(3), major(3), minor(3)
 - Exit:    _exit(2)
 - Fnmatch: fnmatch(3)
 - Fsync:   sync(2)
 - Mkdtemp: mkdtemp(3)
 - StatVFS: statvfs(2)
2017-02-22 14:55:12 +00:00
Richard W.M. Jones
6130411a59 Version 1.35.26. v1.35.26 2017-02-21 20:07:43 +00:00
Richard W.M. Jones
a1b3d8d04b tests: Extend $TEST_FUNCTIONS with predefined functions for skipping tests etc.
Apply this change across all the shell scripts containing tests.

Additionally this defines the environment variables $abs_srcdir,
$abs_builddir, $top_srcdir, $top_builddir, $abs_top_srcdir and
$abs_top_builddir which can now be used throughout test scripts.
2017-02-21 17:23:22 +00:00
Richard W.M. Jones
e66be44016 tests: Add $TEST_FUNCTIONS.
This macro(?) expands to some shell script to source the
tests/test-functions.sh file from its correct location.  The intention
is to use this in all tests, but in this commit only the existing
tests which already include test-functions.sh are modified.
2017-02-21 17:23:22 +00:00
Richard W.M. Jones
51a703775c tests: Rename test-data/test-utils.sh -> tests/test-functions.sh.
This is pure code motion.
2017-02-21 17:23:22 +00:00
Richard W.M. Jones
3a4a491712 generator: Put all the daemon procedure numbers (proc_nr) into a single table.
Daemon 'proc_nr's have to be assigned monotonically and uniquely to
each daemon function.  However in practice it can be difficult to work
out which is the next free proc_nr.  Placing all of them into a single
table in a new file (proc_nr.ml) should make this easier.
2017-02-21 17:23:21 +00:00
Richard W.M. Jones
cf3001c2ed generator: Move guestfish commands to new module Fish_commands. 2017-02-21 17:23:21 +00:00
Richard W.M. Jones
97773d2bbe generator: Group and move APIs from actions.ml into actions_*.ml.
Group the APIs logically and move them into new modules:

Actions_core:
  Core APIs and anything that doesn't fit into another group, eg. launch.
  (With some more effort this could be split further.)

Actions_augeas:
  Augeas APIs, eg. aug-init.

Actions_debug:
  Debug APIs.

Actions_hivex:
  Hivex APIs, eg. hivex-open.

Actions_inspection:
  Inspection APIs, eg. inspect-get-type.

Actions_properties:
  Handle properties, eg. set-hv, get-hv.

Actions_tsk:
  SleuthKit APIs, eg. filesystem-walk.

*_deprecated:
  All of the above modules have deprecated variants, where we
  place the deprecated actions.
2017-02-21 17:23:21 +00:00
Richard W.M. Jones
736ee3586f generator: Move test APIs to new module. 2017-02-21 17:23:21 +00:00
Richard W.M. Jones
7d6fcfc733 generator: Move defaults to Types module.
Just code motion in preparation for the following commits.
2017-02-21 17:23:21 +00:00
Richard W.M. Jones
18777adf31 generator: Stablise output of common/protocol/*, daemon/*, lib/* and tests/c-api/tests.c
Sort the functions so the output is stable.

This changes the order in which the C API tests run.  Previously we
ran the newest tests first, which was useful when we were frequently
adding new APIs.  Now we run them in sorted order.
2017-02-21 17:23:21 +00:00
Richard W.M. Jones
5b0fa9ced9 generator: Generate stable UUID from contents of all action*.ml files.
Also rename the function 'uuidgen ()' (conflicts with a same-named
function in Common_utils) to 'stable_uuid'.  Notice that the UUID is
now only computed once per run of the generator, whereas previously
the same value was computed over and over again.
2017-02-21 17:23:21 +00:00
Pino Toscano
dc159ac5a1 dib: rename "aux" to "in_target.aux"
Sadly, there are elements (hello "gentoo"!) that, during the cleanup.d
phase, wipe out almost everything in the /tmp of the guest, including
the /tmp/aux where virt-dib mounts the auxiliary data. Since that
removal excludes things starting with "in_target" (mostly to avoid
wiping the "in_target.d" that disk-image-create itself sets up, then
rename our "aux" subdirectory to "in_target.aux" to work it around.

Hopefully, the "gentoo" element will be fixed upstream:
https://review.openstack.org/#/c/436101/
2017-02-21 18:05:03 +01:00
Pino Toscano
57a638234e dib: handle lack of phases when reloading scripts list
Commit 8ee51ee396 re-scans for the
available scripts when running certain phases; OTOH, some of them may be
missing, usually due to the lack of scripts for that phase in the
selected set of elements.

Indeed, if there is no directory for a phase, safely raise Not_found so
the case is handled as if the phase was missing in the final_hooks
Hashtbl.
2017-02-21 18:05:03 +01:00
Pino Toscano
e4adfed804 dib: unset all temporary dirs envvars in fake-sudo
The real sudo does it as well, and leaving them when preserving the
environment (-E) maybe breaks the applications, as e.g. chroot will have
a TMPDIR path pointing outside of it.
2017-02-21 18:05:02 +01:00
Richard W.M. Jones
cc0b961b68 Use the new Windows software/system hive APIs in various places. 2017-02-21 13:33:42 +00:00
Richard W.M. Jones
7ac977f12c New APIs: guestfs_inspect_get_windows_software_hive and guestfs_inspect_get_windows_system_hive.
The inspection code already computed the paths of the software hive
(twice!) and the system hive, plus we also recompute the same paths
elsewhere, in virt-v2v for example.  Therefore it makes sense to store
the paths from the inspection code and make them available through two
new APIs.
2017-02-21 13:33:42 +00:00
Richard W.M. Jones
e2a661f49b v2v: Simplify and document gnarly set_reg_val_dword_1 function. 2017-02-21 12:08:45 +00:00